diff --git a/Doc/c-api/structures.rst b/Doc/c-api/structures.rst --- a/Doc/c-api/structures.rst +++ b/Doc/c-api/structures.rst @@ -282,3 +282,18 @@ read-only access. Using :c:macro:`T_STRING` for :attr:`type` implies :c:macro:`READONLY`. Only :c:macro:`T_OBJECT` and :c:macro:`T_OBJECT_EX` members can be deleted. (They are set to *NULL*). + +.. c:function:: PyObject* PyCFunction_NewEx(PyMethodDef *ml, PyObject *self, PyObject *module) + + Create a new :c:type:`PyCFunctionObject` object. *ml* points to a + :c:type:`PyMethodDef` describing the C function that will be + called. *self* is a :c:type:`PyObject` that will be passed as + *self* to the C function, and can be *NULL*. *module* will be set + as the :attr:`__module__` attribute of the :c:type:`PyCFunction` + object and can also be *NULL*. + +.. c:function:: PyObject* PyCFunction_New(PyMethodDef *ml, PyObject *self) + + A variant of :c:func:`PyCFunction_NewEx` that takes *ml* and + *self*, but sets the :attr:`__module__` attribute of the resulting + :c:type:`PyCFunctionObject` to *NULL*.