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

[3.7] bpo-38159: Clarify documentation of PyState_AddModule (GH-16101) by miss-islington · Pull Request #17027 · python/cpython · GitHub

Repository navigation

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .rst  (1) 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
11 changes: 11 additions & 0 deletions Doc/c-api/module.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 @@ -485,10 +485,21 @@ since multiple such modules can be created from a single definition.

Only effective on modules created using single-phase initialization.

Python calls ``PyState_AddModule`` automatically after importing a module,
so it is unnecessary (but harmless) to call it from module initialization
code. An explicit call is needed only if the module's own init code
subsequently calls ``PyState_FindModule``.
The function is mainly intended for implementing alternative import
mechanisms (either by calling it directly, or by referring to its
implementation for details of the required state updates).

Return 0 on success or -1 on failure.

.. versionadded:: 3.3

.. c:function:: int PyState_RemoveModule(PyModuleDef *def)

Removes the module object created from *def* from the interpreter state.
Return 0 on success or -1 on failure.

.. versionadded:: 3.3

Back | FazBrowse Home | New Git URL