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

NumPy numpy-tickets at scipy.net
Tue Sep 19 04:44:11 CDT 2006

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

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



 My problem is that I want to create a ndarray object in python space and
 get its size from C space in a way independent of 32/64 bit platform

 So, when I create, say, n = numpy.array([1], dtype=numpy.int32) I would
 want to get the code for the equivalent enum type of the same size no
 matter of the platform (32/64) the code is running on. IMO, numpy.int32 is
 descriptive enough to be always translated to NPY_INT (its is 32 bit in
 all platforms), in the same way that numpy.int64 should be translated to
 NPY_LONGLONG. However, if I specify numpy.int_, then this has to be the
 equivalent to python int and should be translated to NPY_LONG, I agree.

 Perhaps I'm missing some other issues, but I still think that my proposal
 would help to better deal with types between Python and C levels, and,
 more importantly, I do think that this is more consistent than the current


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