[Numpy-discussion] Different numpy.int64 in 64 bit platforms?

Ivan Vilata i Balaguer ivilata at carabos.com
Tue Dec 26 06:31:43 EST 2006


I have come across this strange behaviour of NumPy 1.0.1 under a 64 bit
AMD Opteron:

>>> import numpy
>>> numpy.__version__
'1.0.1'
>>> numpy.dtype(int).type
<type 'numpy.int64'>
>>> numpy.dtype(int).type is numpy.int64
True
>>> numpy.dtype('int64').type
<type 'numpy.int64'>
>>> numpy.dtype('int64').type is numpy.int64
True
>>> numpy.dtype(long).type
<type 'numpy.int64'>
>>> numpy.dtype(long).type is numpy.int64  # strange, but ok
False
>>> issubclass(numpy.dtype(long).type, numpy.int64)  # what?
False

I.e. the NumPy type used for ``long`` is not the same than for ``int``
or explicit ``'int64'``, not even an instance.  Is this a bug or is this
kind of type comparisons discouraged?  Thanks!

::

	Ivan Vilata i Balaguer   >qo<   http://www.carabos.com/
	       Cárabos Coop. V.  V  V   Enjoy Data
	                          ""
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 309 bytes
Desc: Digital signature
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20061226/16d5f9bc/attachment.sig>


More information about the NumPy-Discussion mailing list