summaryrefslogtreecommitdiff
path: root/numpy/lib/twodim_base.py
diff options
context:
space:
mode:
authorStefan van der Walt <stefan@sun.ac.za>2007-09-30 10:41:27 +0000
committerStefan van der Walt <stefan@sun.ac.za>2007-09-30 10:41:27 +0000
commit325cd587fd8fb15c6b9e69621fa1ae0a54ab8fe5 (patch)
tree0693485c0acbe4107b4bd18086b78419de84e7bc /numpy/lib/twodim_base.py
parent38cb2ac1c22916d6426055b11e9e870d3f5f7f10 (diff)
downloadnumpy-325cd587fd8fb15c6b9e69621fa1ae0a54ab8fe5.tar.gz
Fix tri when dtype is bool (closes ticket #574).
Diffstat (limited to 'numpy/lib/twodim_base.py')
-rw-r--r--numpy/lib/twodim_base.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/numpy/lib/twodim_base.py b/numpy/lib/twodim_base.py
index a53790e41..a067139af 100644
--- a/numpy/lib/twodim_base.py
+++ b/numpy/lib/twodim_base.py
@@ -108,8 +108,7 @@ def tri(N, M=None, k=0, dtype=float):
"""
if M is None: M = N
m = greater_equal(subtract.outer(arange(N), arange(M)),-k)
- if m.dtype != dtype:
- return m.astype(dtype)
+ return m.astype(dtype)
def tril(m, k=0):
""" returns the elements on and below the k-th diagonal of m. k=0 is the