Most of the public functions in the C API have named parameters and both of these functions are documented with named parameters:
https://docs.python.org/3.15/c-api/module.html#c.PyModule_FromSlotsAndSpec
https://docs.python.org/3.15/c-api/module.html#c.PyModule_GetToken
While wrapping these APIs for PyO3, I noticed that the public definitions just have types for the first parameter without an explicit name:
| #if !defined(Py_LIMITED_API) ||Py_LIMITED_API+0 >= _Py_PACK_VERSION(3, 15) |
| PyAPI_FUNC(PyObject*) PyModule_FromSlotsAndSpec(constPyModuleDef_Slot*, |
| 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); |
| #endif |
It'd be nice for those interfaces to match the names in the docs.
This code was added in #140556. I don't see any discussion about this, I think it was just missed.
Linked PRs
Most of the public functions in the C API have named parameters and both of these functions are documented with named parameters:
https://docs.python.org/3.15/c-api/module.html#c.PyModule_FromSlotsAndSpec
https://docs.python.org/3.15/c-api/module.html#c.PyModule_GetToken
While wrapping these APIs for PyO3, I noticed that the public definitions just have types for the first parameter without an explicit name:
cpython/Include/moduleobject.h
Lines 120 to 126 in c461aa9
It'd be nice for those interfaces to match the names in the docs.
This code was added in #140556. I don't see any discussion about this, I think it was just missed.
Linked PRs