https://github.com/python/cpython/commit/f2b5c206c788d3a5bf2ab7c63fb69d3b802646f4
commit: f2b5c206c788d3a5bf2ab7c63fb69d3b802646f4
branch: main
author: Nathan Goldbaum <[email protected]>
committer: encukou <[email protected]>
date: 2026-01-27T10:28:28Z
summary:
gh-143883: Use named parameters in PyModExport-related declarations & docs
(GH-143884)
files:
M Doc/c-api/module.rst
M Include/moduleobject.h
diff --git a/Doc/c-api/module.rst b/Doc/c-api/module.rst
index 90f55add56bf52..e8a6e09f5554ec 100644
--- a/Doc/c-api/module.rst
+++ b/Doc/c-api/module.rst
@@ -426,10 +426,10 @@ To retrieve the state from a given module, use the
following functions:
module state.
-.. c:function:: int PyModule_GetStateSize(PyObject *, Py_ssize_t *result)
+.. c:function:: int PyModule_GetStateSize(PyObject *module, Py_ssize_t *result)
- Set *\*result* to the size of the module's state, as specified using
- :c:macro:`Py_mod_state_size` (or :c:member:`PyModuleDef.m_size`),
+ Set *\*result* to the size of *module*'s state, as specified
+ using :c:macro:`Py_mod_state_size` (or :c:member:`PyModuleDef.m_size`),
and return 0.
On error, set *\*result* to -1, and return -1 with an exception set.
@@ -597,7 +597,7 @@ A module's token -- and the *your_token* value to use in
the above code -- is:
.. c:function:: int PyModule_GetToken(PyObject *module, void** result)
- Set *\*result* to the module's token and return 0.
+ Set *\*result* to the module token for *module* and return 0.
On error, set *\*result* to NULL, and return -1 with an exception set.
@@ -645,7 +645,7 @@ rather than from an extension's :ref:`export hook
<extension-export-hook>`.
.. c:function:: int PyModule_Exec(PyObject *module)
- Execute the :c:data:`Py_mod_exec` slot(s) of the given *module*.
+ Execute the :c:data:`Py_mod_exec` slot(s) of *module*.
On success, return 0.
On error, return -1 with an exception set.
diff --git a/Include/moduleobject.h b/Include/moduleobject.h
index e83bc395aa4618..d1dde7982ad50d 100644
--- a/Include/moduleobject.h
+++ b/Include/moduleobject.h
@@ -118,11 +118,11 @@ PyAPI_FUNC(int) PyUnstable_Module_SetGIL(PyObject
*module, void *gil);
#endif
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= _Py_PACK_VERSION(3, 15)
-PyAPI_FUNC(PyObject *) PyModule_FromSlotsAndSpec(const PyModuleDef_Slot *,
+PyAPI_FUNC(PyObject *) PyModule_FromSlotsAndSpec(const PyModuleDef_Slot *slots,
PyObject *spec);
-PyAPI_FUNC(int) PyModule_Exec(PyObject *mod);
-PyAPI_FUNC(int) PyModule_GetStateSize(PyObject *mod, Py_ssize_t *result);
-PyAPI_FUNC(int) PyModule_GetToken(PyObject *, void **result);
+PyAPI_FUNC(int) PyModule_Exec(PyObject *module);
+PyAPI_FUNC(int) PyModule_GetStateSize(PyObject *module, Py_ssize_t *result);
+PyAPI_FUNC(int) PyModule_GetToken(PyObject *module, void **result);
#endif
#ifndef _Py_OPAQUE_PYOBJECT
_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]