[Numpy-tickets] [NumPy] #574: tri(n, dtype=bool) return None

NumPy numpy-tickets@scipy....
Fri Aug 24 12:19:55 CDT 2007


#574: tri(n, dtype=bool) return None
------------------------+---------------------------------------------------
 Reporter:  zz2liu      |       Owner:  somebody      
     Type:  defect      |      Status:  new           
 Priority:  normal      |   Milestone:                
Component:  numpy.core  |     Version:  1.0.2         
 Severity:  normal      |    Keywords:  tri dtype bool
------------------------+---------------------------------------------------
 def tri(N, M=None, k=0, dtype=float):
         """ returns a N-by-M array where all the diagonals starting from
             lower left corner up to the k-th are all ones.
         """
         if M is None: M = N
         m = greater_equal(subtract.outer(arange(N), arange(M)),-k)
         if m.dtype != dtype:
             return m.astype(dtype)
         #else:
         #   return m

 tri(3, dtype=bool) will return None
 maybe should fix it by adding the block commented to the end of the code.

-- 
Ticket URL: <http://projects.scipy.org/scipy/numpy/ticket/574>
NumPy <http://projects.scipy.org/scipy/numpy>
The fundamental package needed for scientific computing with Python.


More information about the Numpy-tickets mailing list