[issue39762] PyLong_AS_LONG missing from longobject.h

Enji Cooper report at bugs.python.org
Wed Feb 26 17:26:24 EST 2020


Enji Cooper <yaneurabeya at gmail.com> added the comment:

PyInt_AS_LONG doesn't exist on python 3, however:

$ grep -r PyInt_AS_LONG /usr/include/
[/usr/include/python2.7/intobject.h:#define PyInt_AS_LONG(op) (((PyIntObject *)(op))->ob_ival)

The code smell for the pieces that use PyInt_AS_LONG seems a bit questionable since they're used as array indexes; I'll poke a bit more and look at using one of the other sets of C APIs instead in our project.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue39762>
_______________________________________


More information about the Python-bugs-list mailing list