[SciPy-dev] numpy.typeinfo missing

Travis Oliphant oliphant.travis at ieee.org
Tue Jan 24 15:41:29 CST 2006


Pearu Peterson wrote:

>Hi Travis,
>
>Earlier versions of numpy had typeinfo dictionary that contained 
>information about dtype, elsize, dtypechar, bits of an arrays type for 
>given C contant, say BOOL, BYTE, etc.
>
>Now typeinfo dictionary is missing and I wonder what is the current way to 
>resolve the above information from Python?
>
>  
>
It's still there.  But, the dtype objects themselves are much more 
informative.  So just do

d = numpy.dtype(byte)

dir(d)

'__class__', '__cmp__', '__delattr__', '__doc__', '__getattribute__', 
'__hash__', '__init__', '__new__', '__reduce__', '__reduce_ex__', 
'__repr__', '__setattr__', '__setstate__', '__str__', 'alignment', 
'arrdescr', 'byteorder', 'char', 'fields', 'isbuiltin', 'isnative', 
'itemsize', 'kind', 'name', 'newbyteorder', 'num', 'str', 'subdescr', 
'type']

The original dictionary is in numeric.core.multiarray as typeinfo 
(should you need it). 

-Travis




More information about the Scipy-dev mailing list