[Numpy-discussion] numpy.int32, type inheritance and tp_flags
Charles R Harris
charlesr.harris at gmail.com
Tue Jun 2 01:49:23 EDT 2009
On Mon, Jun 1, 2009 at 11:08 PM, David Cournapeau <
david at ar.media.kyoto-u.ac.jp> wrote:
> Hi,
>
> I have a question related to #1121
> (http://projects.scipy.org/numpy/ticket/1121). With python 2.6,
> PyInt_Check(a) if a is an instance of numpy.int32 does not work anymore.
> It think this is related to the python issue 2263
> (http://bugs.python.org/issue2263), where the tp_flags has been changed
> for the python int object, change which influences PyInt_Check behavior.
>
> What should we do about it ? Right now, it looks like the bitfields are
> harcoded in scalar types - shouldn't we inherit them from the original
> python types (in a field per field manner) instead ?
>
Maybe, but why should it work for int32 anyway? IIRC, the python int type
has different lengths on windows and linux 64 bit systems. And what about
3.0?
I think we probably need to do something here, but I'm not sure what. The
different behavior of the numpy double and integer types corresponding to
the python types as opposed to the rest of the scalar types is an issue that
has annoyed me since forever.
Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20090601/ab339a01/attachment.html>
More information about the NumPy-Discussion
mailing list