[pypy-issue] [issue1621] CPyExt: PyObject_GetItem() fails on NumPyPy array objects

Amaury Forgeot d'Arc tracker at bugs.pypy.org
Tue Oct 15 20:43:45 CEST 2013


Amaury Forgeot d'Arc <amauryfa at gmail.com> added the comment:

No, please revert this, in the official API those functions return PyObject:
    PyAPI_FUNC(PyObject *) PyInt_FromLong(long);

And it would not change anything, except maybe a pointer cast.
The point here is that we need cpyext to allocate a PyIntObject structure, i.e. call 
"int_realize()", and this is why the solid_base is important.

PyInt_Check(obj) && ((PyIntObject*)obj)->ob_ival
is the best test.

________________________________________
PyPy bug tracker <tracker at bugs.pypy.org>
<https://bugs.pypy.org/issue1621>
________________________________________


More information about the pypy-issue mailing list