[Numpy-discussion] dtype attributes of scalar types

Travis Oliphant oliphant at ee.byu.edu
Tue Nov 28 18:11:57 CST 2006


Matthew Brett wrote:

>Hi,
>
>Would it be easy and / or sensible for - say - int32.itemsize to
>return the same as dtype(int32).itemsize, rather than the <attribute
>'itemsize' of 'numpy.generic' objects> that it returns at the moment?
>
>  
>
You can do int32(0).itemsize.

Getting the itemsize attribute to "do the right thing" when called from 
the type-object (instead of an instance of the type-object) is beyond my 
current skill.  It might be possible, but I haven't spent the time to 
figure it out.

-Travis



More information about the Numpy-discussion mailing list