Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add comments describing the PyModuleDef_Base fields.
  • Loading branch information
ericsnowcurrently committed Nov 10, 2022
commit 453ca0e102e7aef42ec608deddc7e526a159ed9a
13 changes: 13 additions & 0 deletions Include/moduleobject.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,21 @@ PyAPI_DATA(PyTypeObject) PyModuleDef_Type;

typedef struct PyModuleDef_Base {
PyObject_HEAD
/* The function used to re-initialize the module.
This is only set for legacy (single-phase init) extension modules
and only used for those that support multiple initializations
(m_size >= 0).
It is set by _PyImport_LoadDynamicModuleWithSpec()
and _imp.create_builtin(). */
PyObject* (*m_init)(void);
/* The module's index into its interpreter's modules_by_index cache.
This is set for all extension modules but only used for legacy ones.
It is set by PyModuleDef_Init(). */
Py_ssize_t m_index;
/* A copy of the module's __dict__ after the first time it was loaded.
This is only set/used for legacy modules that do not support
multiple initializations.
It is set by _PyImport_FixupExtensionObject(). */
PyObject* m_copy;
} PyModuleDef_Base;

Expand Down