Skip to content

Commit a0cf7ec

Browse files
committed
Document missing PyCMethod APIs.
1 parent 1f8d65e commit a0cf7ec

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

Doc/c-api/structures.rst

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,25 @@ definition with the same method name.
447447
slot. This is helpful because calls to PyCFunctions are optimized more
448448
than wrapper object calls.
449449
450+
451+
.. c:var:: PyTypeObject PyCMethod_Type
452+
453+
The type object corresponding to Python C method objects. This is
454+
available as :class:`types.BuiltinMethodType` in the Python layer.
455+
456+
457+
.. c:function:: int PyCMethod_Check(PyObject *f)
458+
459+
Return true if *f* is an instance of the :c:type:`PyCMethod_Type` type
460+
or a subtype of it. This function always succeeds.
461+
462+
463+
.. c:function:: int PyCMethod_CheckExact(PyObject *f)
464+
465+
This is the same as :c:func:`PyCMethod_Check`, but does not account for
466+
subtypes.
467+
468+
450469
.. c:function:: PyObject * PyCMethod_New(PyMethodDef *ml, PyObject *self, PyObject *module, PyTypeObject *cls)
451470
452471
Turn *ml* into a Python :term:`callable` object.

0 commit comments

Comments
 (0)