Skip to content

Commit 3bbd669

Browse files
StanFromIrelandZeroIntensityvstinner
authored
[3.13] gh-141004: Document PyImport_Inittab (GH-141844) (GH-142016)
(cherry picked from commit 5f35702) Co-authored-by: Peter Bierma <[email protected]> Co-authored-by: Victor Stinner <[email protected]>
1 parent 80b7522 commit 3bbd669

File tree

4 files changed

+11
-4
lines changed

4 files changed

+11
-4
lines changed

Doc/c-api/import.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,3 +325,10 @@ Importing Modules
325325
If Python is initialized multiple times, :c:func:`PyImport_AppendInittab` or
326326
:c:func:`PyImport_ExtendInittab` must be called before each Python
327327
initialization.
328+
329+
330+
.. c:var:: struct _inittab *PyImport_Inittab
331+
332+
The table of built-in modules used by Python initialization. Do not use this directly;
333+
use :c:func:`PyImport_AppendInittab` and :c:func:`PyImport_ExtendInittab`
334+
instead.

Doc/extending/extending.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ A pointer to the module definition must be returned via :c:func:`PyModuleDef_Ini
426426
so that the import machinery can create the module and store it in ``sys.modules``.
427427

428428
When embedding Python, the :c:func:`!PyInit_spam` function is not called
429-
automatically unless there's an entry in the :c:data:`!PyImport_Inittab` table.
429+
automatically unless there's an entry in the :c:data:`PyImport_Inittab` table.
430430
To add the module to the initialization table, use :c:func:`PyImport_AppendInittab`,
431431
optionally followed by an import of the module::
432432

Misc/NEWS.d/3.11.0a1.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4931,7 +4931,7 @@ Patch by Gabriele N. Tornetta
49314931
.. nonce: 3p14JB
49324932
.. section: C API
49334933
4934-
:c:func:`Py_RunMain` now resets :c:data:`!PyImport_Inittab` to its initial
4934+
:c:func:`Py_RunMain` now resets :c:data:`PyImport_Inittab` to its initial
49354935
value at exit. It must be possible to call :c:func:`PyImport_AppendInittab`
49364936
or :c:func:`PyImport_ExtendInittab` at each Python initialization. Patch by
49374937
Victor Stinner.

Misc/NEWS.d/3.12.0a2.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ Update bundled libexpat to 2.5.0
3535
.. nonce: ik4iOv
3636
.. section: Core and Builtins
3737
38-
The docs clearly say that ``PyImport_Inittab``,
38+
The docs clearly say that :c:data:`PyImport_Inittab`,
3939
:c:func:`PyImport_AppendInittab`, and :c:func:`PyImport_ExtendInittab`
4040
should not be used after :c:func:`Py_Initialize` has been called. We now
4141
enforce this for the two functions. Additionally, the runtime now uses an
42-
internal copy of ``PyImport_Inittab``, to guard against modification.
42+
internal copy of :c:data:`PyImport_Inittab`, to guard against modification.
4343

4444
..
4545

0 commit comments

Comments
 (0)