File tree 1 file changed +11
-0
lines changed 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.
485
485
486
486
Only effective on modules created using single-phase initialization.
487
487
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
+
488
498
.. versionadded:: 3.3
489
499
490
500
.. c:function:: int PyState_RemoveModule(PyModuleDef *def)
491
501
492
502
Removes the module object created from *def * from the interpreter state.
503
+ Return 0 on success or -1 on failure.
493
504
494
505
.. versionadded :: 3.3
You can’t perform that action at this time.
0 commit comments