Matthew Brett wrote: > Hi, > > I was a bit confused by this on 32 bit linux: > > In [30]:sctypes['int'] > Out[30]: > [<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 [38]: import numpy In [39]: id(numpy.dtype('p').type) Out[39]: 62091392 In [40]: id(numpy.int32) Out[40]: 62091200 I'm not entirely sure why this is. -- Robert Kern "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 _______________________________________________ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion