Always declare PyIndex_Check() as an opaque function to hide
implementation details: remove PyIndex_Check() macro. The macro
accessed directly the PyTypeObject.tp_as_number member.
(Py_TYPE(obj)->tp_iternext != NULL && \
Py_TYPE(obj)->tp_iternext != &_PyObject_NextNotImplemented)
-/* === Number Protocol ================================================== */
-
-#define PyIndex_Check(obj) \
- (Py_TYPE(obj)->tp_as_number != NULL && \
- Py_TYPE(obj)->tp_as_number->nb_index != NULL)
-
/* === Sequence protocol ================================================ */
/* Assume tp_as_sequence and sq_item exist and that 'i' does not
--- /dev/null
+Always declare :c:func:`PyIndex_Check` as an opaque function to hide
+implementation details: remove ``PyIndex_Check()`` macro. The macro accessed
+directly the :c:member:`PyTypeObject.tp_as_number` member.
}
-#undef PyIndex_Check
-
int
PyIndex_Check(PyObject *obj)
{