Message318436
The file number.rst on python 3.6 says
"""
.. c:function:: int PyIndex_Check(PyObject *o)
Returns ``1`` if *o* is an index integer (has the nb_index slot of the
tp_as_number structure filled in), and ``0`` otherwise.
"""
But in reality, this is a macro:
"""
#define PyIndex_Check(obj) \
((obj)->ob_type->tp_as_number != NULL && \
(obj)->ob_type->tp_as_number->nb_index != NULL)
"""
But such a macro does not work with the limited API, since
non-heaptypes cannot use PyType_GetSlot.
The patch is trivial: Define the function instead of the macro
when Py_LIMITED_API is set.
I also think the documentation makes more sense when it is correct. |
|
Date |
User |
Action |
Args |
2018-06-01 17:14:59 | Christian.Tismer | set | recipients:
+ Christian.Tismer, larry, ned.deily |
2018-06-01 17:14:59 | Christian.Tismer | set | messageid: <1527873299.01.0.81473610881.issue33738@psf.upfronthosting.co.za> |
2018-06-01 17:14:58 | Christian.Tismer | link | issue33738 messages |
2018-06-01 17:14:58 | Christian.Tismer | create | |
|