![](https://secure.gravatar.com/avatar/158d7ca423031a69f866131f36994fab.jpg?s=120&d=mm&r=g)
hi all, we just noticed the following weird thing: $ python Python 2.6.6rc2 (r266rc2:84114, Aug 18 2010, 07:33:44) [GCC 4.4.5 20100816 (prerelease)] on linux2 Type "help", "copyright", "credits" or "license" for more information.
import numpy numpy.version.version '2.0.0.dev8469' numpy.dtype('float64') == None True numpy.dtype('float32') == None False
is this a bug in the dtype.__eq__ method? ciao, tiziano
![](https://secure.gravatar.com/avatar/f50876dc489df65c750c9fa32f9dd33e.jpg?s=120&d=mm&r=g)
On Mon, Aug 23, 2010 at 06:50:09PM +0200, Tiziano Zito wrote:
hi all, we just noticed the following weird thing:
$ python Python 2.6.6rc2 (r266rc2:84114, Aug 18 2010, 07:33:44) [GCC 4.4.5 20100816 (prerelease)] on linux2 Type "help", "copyright", "credits" or "license" for more information.
import numpy numpy.version.version '2.0.0.dev8469' Also with numpy.version.version == 1.3.0.
Best, Zbyszek
![](https://secure.gravatar.com/avatar/40489da22d2dc0cc12596420bb810463.jpg?s=120&d=mm&r=g)
On Aug 23, 2010, at 11:55 AM, Zbyszek Szmek wrote:
On Mon, Aug 23, 2010 at 06:50:09PM +0200, Tiziano Zito wrote:
hi all, we just noticed the following weird thing:
$ python Python 2.6.6rc2 (r266rc2:84114, Aug 18 2010, 07:33:44) [GCC 4.4.5 20100816 (prerelease)] on linux2 Type "help", "copyright", "credits" or "license" for more information.
import numpy numpy.version.version '2.0.0.dev8469' Also with numpy.version.version == 1.3.0.
This certainly looks odd. If you can file a bug-report that would be great. -Travis
Best, Zbyszek _______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
--- Travis Oliphant Enthought, Inc. oliphant@enthought.com 1-512-536-1057 http://www.enthought.com
![](https://secure.gravatar.com/avatar/f50876dc489df65c750c9fa32f9dd33e.jpg?s=120&d=mm&r=g)
On Wed, Aug 25, 2010 at 12:41:37PM -0500, Travis Oliphant wrote:
On Aug 23, 2010, at 11:55 AM, Zbyszek Szmek wrote:
On Mon, Aug 23, 2010 at 06:50:09PM +0200, Tiziano Zito wrote:
hi all, we just noticed the following weird thing:
$ python Python 2.6.6rc2 (r266rc2:84114, Aug 18 2010, 07:33:44) [GCC 4.4.5 20100816 (prerelease)] on linux2 Type "help", "copyright", "credits" or "license" for more information.
import numpy numpy.version.version '2.0.0.dev8469' Also with numpy.version.version == 1.3.0.
This certainly looks odd. If you can file a bug-report that would be great.
arraydescr_richcompare calls PyArray_DescrConverter, which converts None to PyArray_DEFAULT... /*NUMPY_API * Get typenum from an object -- None goes to PyArray_DEFAULT * This function takes a Python object representing a type and converts it * to a the correct PyArray_Descr * structure to describe the type. * * Many objects can be used to represent a data-type which in NumPy is * quite a flexible concept. * * This is the central code that converts Python objects to * Type-descriptor objects that are used throughout numpy. * new reference in *at */ NPY_NO_EXPORT int PyArray_DescrConverter(PyObject *obj, PyArray_Descr **at) So:
numpy.dtype('float32') == '<f4' True numpy.dtype('float32') == 'float64' False numpy.dtype('float32') == 'float32' True numpy.dtype('float32') == 'float33' Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: data type not understood
I think that this automatic conversion is pretty dangerous, especially in case of None. Best, Zbyszek
![](https://secure.gravatar.com/avatar/f50876dc489df65c750c9fa32f9dd33e.jpg?s=120&d=mm&r=g)
participants (3)
-
Tiziano Zito
-
Travis Oliphant
-
Zbyszek Szmek