Skip to content

Commit 67be7bd

Browse files
encukouerlend-aasland
authored andcommitted
bpo-46613: Add PyType_GetModuleByDef to the public API (python/cpython#31081)
* Make PyType_GetModuleByDef public (remove underscore) Co-authored-by: Victor Stinner <[email protected]> GitHub-Issue-Link: python/cpython#90771
1 parent 219b7e9 commit 67be7bd

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Doc/howto/clinic.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1249,15 +1249,15 @@ The ``defining_class`` converter is not compatible with ``__init__`` and ``__new
12491249
methods, which cannot use the ``METH_METHOD`` convention.
12501250

12511251
It is not possible to use ``defining_class`` with slot methods. In order to
1252-
fetch the module state from such methods, use ``_PyType_GetModuleByDef`` to
1253-
look up the module and then :c:func:`PyModule_GetState` to fetch the module
1252+
fetch the module state from such methods, use :c:func:`PyType_GetModuleByDef`
1253+
to look up the module and then :c:func:`PyModule_GetState` to fetch the module
12541254
state. Example from the ``setattro`` slot method in
12551255
``Modules/_threadmodule.c``::
12561256

12571257
static int
12581258
local_setattro(localobject *self, PyObject *name, PyObject *v)
12591259
{
1260-
PyObject *module = _PyType_GetModuleByDef(Py_TYPE(self), &thread_module);
1260+
PyObject *module = PyType_GetModuleByDef(Py_TYPE(self), &thread_module);
12611261
thread_module_state *state = get_thread_state(module);
12621262
...
12631263
}

0 commit comments

Comments
 (0)