cpython/Doc/extending
Petr Viktorin f4bc3a9320
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>
2025-06-13 16:39:35 +02:00
..
building.rst gh-134160: Split extension module init from PyModule docs; emphasize multi-phase init (GH-135126) 2025-06-13 16:39:35 +02:00
embedding.rst gh-134160: Use multi-phase init in documentation examples (#134296) 2025-05-26 21:43:35 +00:00
extending.rst gh-134160: Block multiple module initialization (#134773) 2025-05-28 08:53:04 +01:00
index.rst gh-133678: Document C API third party tools (#134526) 2025-05-27 17:38:30 +02:00
newtypes.rst gh-111178: fix incorrect function signatures in docs (#132395) 2025-04-11 14:59:38 +00:00
newtypes_tutorial.rst gh-134160: Use multi-phase init in documentation examples (#134296) 2025-05-26 21:43:35 +00:00
windows.rst gh-134830: Fix reference in Doc/extending/windows.rst (GH-134831) 2025-06-03 00:08:20 +02:00