mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
gh-116146: Add C-API to create module from spec and initfunc (GH-139196)
Co-authored-by: Kumar Aditya <kumaraditya@python.org> Co-authored-by: Petr Viktorin <encukou@gmail.com> Co-authored-by: Victor Stinner <vstinner@python.org>
This commit is contained in:
parent
a4dd66275b
commit
1e4e59bb37
7 changed files with 223 additions and 21 deletions
|
|
@ -10,6 +10,13 @@ struct _inittab {
|
|||
PyAPI_DATA(struct _inittab *) PyImport_Inittab;
|
||||
PyAPI_FUNC(int) PyImport_ExtendInittab(struct _inittab *newtab);
|
||||
|
||||
// Custom importers may use this API to initialize statically linked
|
||||
// extension modules directly from a spec and init function,
|
||||
// without needing to go through inittab
|
||||
PyAPI_FUNC(PyObject *) PyImport_CreateModuleFromInitfunc(
|
||||
PyObject *spec,
|
||||
PyObject *(*initfunc)(void));
|
||||
|
||||
struct _frozen {
|
||||
const char *name; /* ASCII encoded string */
|
||||
const unsigned char *code;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue