FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

[3.13] gh-141004: Document `PyImport_Inittab` (GH-141844) by StanFromIreland · Pull Request #142016 · python/cpython · GitHub

/ cpython Public
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .rst  (4) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
7 changes: 7 additions & 0 deletions Doc/c-api/import.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -325,3 +325,10 @@ Importing Modules
If Python is initialized multiple times, :c:func:`PyImport_AppendInittab` or
:c:func:`PyImport_ExtendInittab` must be called before each Python
initialization.


.. c:var:: struct _inittab *PyImport_Inittab

The table of built-in modules used by Python initialization. Do not use this directly;
use :c:func:`PyImport_AppendInittab` and :c:func:`PyImport_ExtendInittab`
instead.
2 changes: 1 addition & 1 deletion Doc/extending/extending.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ A pointer to the module definition must be returned via :c:func:`PyModuleDef_Ini
so that the import machinery can create the module and store it in ``sys.modules``.

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

Expand Down
2 changes: 1 addition & 1 deletion Misc/NEWS.d/3.11.0a1.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -4931,7 +4931,7 @@ Patch by Gabriele N. Tornetta
.. nonce: 3p14JB
.. section: C API

:c:func:`Py_RunMain` now resets :c:data:`!PyImport_Inittab` to its initial
:c:func:`Py_RunMain` now resets :c:data:`PyImport_Inittab` to its initial
value at exit. It must be possible to call :c:func:`PyImport_AppendInittab`
or :c:func:`PyImport_ExtendInittab` at each Python initialization. Patch by
Victor Stinner.
Expand Down
4 changes: 2 additions & 2 deletions Misc/NEWS.d/3.12.0a2.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ Update bundled libexpat to 2.5.0
.. nonce: ik4iOv
.. section: Core and Builtins

The docs clearly say that ``PyImport_Inittab``,
The docs clearly say that :c:data:`PyImport_Inittab`,
:c:func:`PyImport_AppendInittab`, and :c:func:`PyImport_ExtendInittab`
should not be used after :c:func:`Py_Initialize` has been called. We now
enforce this for the two functions. Additionally, the runtime now uses an
internal copy of ``PyImport_Inittab``, to guard against modification.
internal copy of :c:data:`PyImport_Inittab`, to guard against modification.

..

Expand Down
Loading

Back | FazBrowse Home | New Git URL