[Numpy-tickets] [NumPy] #283: Inconsisteny in enumerated type mapping

NumPy numpy-tickets at scipy.net
Mon Sep 18 15:31:54 CDT 2006

#283: Inconsisteny in enumerated type mapping
 Reporter:  faltet      |        Owner:  somebody   
     Type:  defect      |       Status:  closed     
 Priority:  normal      |    Milestone:  1.0 Release
Component:  numpy.core  |      Version:  devel      
 Severity:  normal      |   Resolution:  invalid    
 Keywords:              |  
Changes (by oliphant):

  * status:  new => closed
  * resolution:  => invalid


 sctypeDict[7] and sctypeDict['l'] does return "numpy.int_"  --- that's
 just not the way that scalar object reports itself.

 The NPY_LONG is always given first dibs when int32 is asked for.  So, you
 are correct, that on (most) 64-bit platforms (with the notable exception
 of Windows) you will actually get NPY_INT when you ask for int32, but on
 most 32-bit platforms you will get NPY_LONG.  The reason to get NPY_LONG
 is mainly because "long" is the type of the Python integer.

 I'm really not sure what the problem is though.  Just use NPY_INT32 on
 both platforms in C (npy_int32 is a C-type you can use as well), and you
 will be fine.

Ticket URL: <http://projects.scipy.org/scipy/numpy/ticket/283>
NumPy <http://projects.scipy.org/scipy/numpy>
The fundamental package needed for scientific computing with Python.

More information about the Numpy-tickets mailing list