mirror of
https://github.com/python/cpython.git
synced 2025-11-01 18:51:43 +00:00
gh-107954, PEP 741: Add PyInitConfig_AddModule() function (#123668)
This commit is contained in:
parent
7d2c2f24da
commit
0d6b6e34a2
7 changed files with 121 additions and 0 deletions
|
|
@ -1744,6 +1744,26 @@ only implemented when ``Py_InitializeFromInitConfig()`` is called, not by the
|
|||
* Set an error in *config* and return ``-1`` on error.
|
||||
|
||||
|
||||
Module
|
||||
------
|
||||
|
||||
.. c:function:: int PyInitConfig_AddModule(PyInitConfig *config, const char *name, PyObject* (*initfunc)(void))
|
||||
|
||||
Add a built-in extension module to the table of built-in modules.
|
||||
|
||||
The new module can be imported by the name *name*, and uses the function
|
||||
*initfunc* as the initialization function called on the first attempted
|
||||
import.
|
||||
|
||||
* Return ``0`` on success.
|
||||
* Set an error in *config* and return ``-1`` on error.
|
||||
|
||||
If Python is initialized multiple times, ``PyInitConfig_AddModule()`` must
|
||||
be called at each Python initialization.
|
||||
|
||||
Similar to the :c:func:`PyImport_AppendInittab` function.
|
||||
|
||||
|
||||
Initialize Python
|
||||
-----------------
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue