[Numpy-tickets] [NumPy] #1001: dype comparison with other types raise a TypeError

NumPy numpy-tickets@scipy....
Fri Feb 6 01:11:01 CST 2009


#1001: dype comparison with other types raise a TypeError
-------------------------+--------------------------------------------------
 Reporter:  ashleywalsh  |       Owner:  somebody
     Type:  defect       |      Status:  new     
 Priority:  normal       |   Milestone:  1.3.0   
Component:  Other        |     Version:  none    
 Severity:  normal       |    Keywords:          
-------------------------+--------------------------------------------------
 If you compare a dtype with another object for equality a TypeError is
 raised if the second object cannot be converted to a dtype:
 {{{
 >>> import numpy
 >>> numpy.dtype(float) == 'float'
 True
 >>> numpy.dtype(float) == 'i'
 False
 >>> numpy.dtype(float) == object()
 Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
 TypeError: data type not understood
 >>> numpy.dtype(float) == 'x'
 Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
 TypeError: data type not understood
 }}}

 In my case this caused epydoc to crash because it attempted to compare a
 dtype that was class attribute with (I think) an object was an attribute
 of the same name on a super-class.

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


More information about the Numpy-tickets mailing list