]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-134160: Split extension module init from PyModule docs; emphasize multi-phase...
authorPetr Viktorin <encukou@gmail.com>
Fri, 13 Jun 2025 14:39:35 +0000 (16:39 +0200)
committerGitHub <noreply@github.com>
Fri, 13 Jun 2025 14:39:35 +0000 (16:39 +0200)
commitf4bc3a932082411243da9bb909841138ee2eea97
tree7eeae8b124d1b40b3f4226d6b36fc399f97589df
parent394d7985da50189e123d0908e9a282f6da31ed78
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 <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Doc/c-api/extension-modules.rst [new file with mode: 0644]
Doc/c-api/index.rst
Doc/c-api/intro.rst
Doc/c-api/module.rst
Doc/data/refcounts.dat
Doc/extending/building.rst