SIGN IN SIGN UP
python / cpython UNCLAIMED

The Python programming language

0 0 0 Python

gh-134160: Split extension module init from PyModule docs; emphasize multi-phase init (GH-135126)

Document behaviour of single-phase init. Call it "legacy".

Reorganize PyModule docs.

Move PyInit_modulename docs from the tutorial to reference documentation.

Move PyMODINIT_FUNC docs from generic macros to the new page.

Add doc stubs for `PYTHON_API_VERSION` & `PYTHON_ABI_VERSION`

Remove incorrect refcounts.dat entry for `PyModuleDef_Init`.
This removes the "Return value: Borrowed reference." note.
Instead, note that the function sometimes returns a borrowed reference,
sometimes as strong one.
(IMO, it's best to not think of `PyModuleDef` as a `PyObject` at all,
and act like it can't be reference-counted.)


Co-authored-by: Adam Turner <[email protected]>
Co-authored-by: Stan Ulbrych <[email protected]>
Co-authored-by: Hugo van Kemenade <[email protected]>
P
Petr Viktorin committed
f4bc3a932082411243da9bb909841138ee2eea97
Parent: 394d798
Committed by GitHub <[email protected]> on 6/13/2025, 2:39:35 PM