File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -485,10 +485,21 @@ since multiple such modules can be created from a single definition.
485485
486486 Only effective on modules created using single-phase initialization.
487487
488+ Python calls ``PyState_AddModule `` automatically after importing a module,
489+ so it is unnecessary (but harmless) to call it from module initialization
490+ code. An explicit call is needed only if the module's own init code
491+ subsequently calls ``PyState_FindModule``.
492+ The function is mainly intended for implementing alternative import
493+ mechanisms (either by calling it directly, or by referring to its
494+ implementation for details of the required state updates).
495+
496+ Return 0 on success or -1 on failure.
497+
488498 .. versionadded:: 3.3
489499
490500.. c:function:: int PyState_RemoveModule(PyModuleDef *def)
491501
492502 Removes the module object created from *def * from the interpreter state.
503+ Return 0 on success or -1 on failure.
493504
494505 .. versionadded :: 3.3
You can’t perform that action at this time.
0 commit comments