[Numpy-discussion] int32 twice in sctypes?
robert.kern at gmail.com
Tue Nov 28 17:20:53 CST 2006
Matthew Brett wrote:
> I was a bit confused by this on 32 bit linux:
> In :sctypes['int']
> [<type 'numpy.int8'>,
> <type 'numpy.int16'>,
> <type 'numpy.int32'>,
> <type 'numpy.int64'>,
> <type 'numpy.int32'>]
> Is it easy to explain the two entries for int32 here? I notice there
> is only one int32 entry for the same test on my 64 bit system.
Hmm. When we construct that dictionary, we put in all of the explicit integer
types (8, 16, 32, 64), and then add the "pointer"-width integer if it's not
already there. However, at least on my machine and yours, the actual scalar type
objects are different (although they represent the same information).
In : import numpy
In : id(numpy.dtype('p').type)
In : id(numpy.int32)
I'm not entirely sure why this is.
"I have come to believe that the whole world is an enigma, a harmless enigma
that is made terrible by our own mad attempt to interpret it as though it had
an underlying truth."
-- Umberto Eco
More information about the Numpy-discussion