Skip to content

Commit d5be6e5

Browse files
committed
Document the new PyImport_CreateModuleFromInitfunc C-API
1 parent d38c0e4 commit d5be6e5

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

Doc/c-api/import.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,3 +333,15 @@ Importing Modules
333333
strings instead of Python :class:`str` objects.
334334
335335
.. versionadded:: 3.14
336+
337+
.. c:function:: PyObject* PyImport_CreateModuleFromInitfunc(PyObject *spec, PyObject* (*initfunc)(void))
338+
339+
This function is a building block that enables embedders to implement custom
340+
static extension importers (e.g. of statically-linked extensions).
341+
The function creates and returns a module object given a *spec* and an *initfunc*.
342+
343+
*spec* must be a :class:`~importlib.machinery.ModuleSpec` object
344+
345+
*initfunc* is the same as in :c:func:`PyImport_ExtendInittab`
346+
347+
.. versionadded:: 3.15

0 commit comments

Comments
 (0)