[Numpy-discussion] numpy.int32 is not subclass of int, but numpy.int64 is
Mon Nov 14 14:18:36 CST 2011
Could someone explain this?
An instance of numpy.int32 is not an instance of int or numpy.int.
An instance of numpy.int64 is an instance of int and numpy.int.
I don't know if it is a bug in my linux build.
Python 2.6.2 (r262:71600, Jul 8 2010, 11:49:56)
[GCC 4.1.2 20070115 (SUSE Linux)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
>>> a = numpy.array((1,2,3))
>>> isinstance(a, int)
>>> isinstance(a, numpy.int)
>>> seven = numpy.int64(7)
>>> isinstance(seven, numpy.int)
>>> isinstance(seven, int)
>>> five = numpy.int32(5)
>>> isinstance(five, numpy.int)
>>> isinstance(five, int)
>>> issubclass(numpy.int64, numpy.int)
>>> issubclass(numpy.int32, numpy.int)
>>> import sys
>>> import platform
>>> print platform.platform()
This email and any attachments are intended solely for the use of the individual or entity to whom it is addressed and may be confidential and/or privileged.
If you are not one of the named recipients or have received this email in error,
(i) you should not read, disclose, or copy it,
(ii) please notify sender of your receipt by reply email and delete this email and all attachments,
(iii) Dassault Systemes does not accept or assume any liability or responsibility for any use of or reliance on this email.
For other languages, go to http://www.3ds.com/terms/email-disclaimer
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the NumPy-Discussion