Skip to content
Merged
Show file tree
Hide file tree
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
ditto (for copy-paste)
  • Loading branch information
neonene committed May 22, 2025
commit d68e3e33cd0681f46422cde28d75889aa04555cf
18 changes: 18 additions & 0 deletions Doc/extending/extending.rst
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,14 @@ with an exception object::

static PyModuleDef_Slot spam_module_slots[] = {
{Py_mod_exec, spam_module_exec},
#ifdef Py_mod_multiple_interpreters
// signal that this module can be imported in isolated subinterpreters
{Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
#endif
#ifdef Py_mod_gil
// signal that this module supports running without an active GIL
{Py_mod_gil, Py_MOD_GIL_NOT_USED},
#endif
{0, NULL}
};

Expand Down Expand Up @@ -829,8 +835,12 @@ Philbrick (philbrick@hks.com)::
};

static PyModuleDef_Slot keywdarg_slots[] = {
#ifdef Py_mod_multiple_interpreters
{Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
#endif
#ifdef Py_mod_gil
{Py_mod_gil, Py_MOD_GIL_NOT_USED},
#endif
{0, NULL}
};

Expand Down Expand Up @@ -1333,8 +1343,12 @@ function must take care of initializing the C API pointer array::

static PyModuleDef_Slot spam_module_slots[] = {
{Py_mod_exec, spam_module_exec},
#ifdef Py_mod_multiple_interpreters
{Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
#endif
#ifdef Py_mod_gil
{Py_mod_gil, Py_MOD_GIL_NOT_USED},
#endif
{0, NULL}
};

Expand Down Expand Up @@ -1412,8 +1426,12 @@ like this::

static PyModuleDef_Slot client_module_slots[] = {
{Py_mod_exec, client_module_exec},
#ifdef Py_mod_multiple_interpreters
{Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
#endif
#ifdef Py_mod_gil
{Py_mod_gil, Py_MOD_GIL_NOT_USED},
#endif
{0, NULL}
};

Expand Down
4 changes: 4 additions & 0 deletions Doc/includes/newtypes/custom.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,13 @@ custom_module_exec(PyObject *mod)

static PyModuleDef_Slot custom_module_slots[] = {
{Py_mod_exec, custom_module_exec},
#ifdef Py_mod_multiple_interpreters
// Py_MOD_PER_INTERPRETER_GIL_SUPPORTED requires heaptypes
{Py_mod_multiple_interpreters, Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED},
#endif
#ifdef Py_mod_gil
{Py_mod_gil, Py_MOD_GIL_NOT_USED},
#endif
{0, NULL}
};

Expand Down
4 changes: 4 additions & 0 deletions Doc/includes/newtypes/custom2.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,13 @@ custom_module_exec(PyObject *mod)

static PyModuleDef_Slot custom_module_slots[] = {
{Py_mod_exec, custom_module_exec},
#ifdef Py_mod_multiple_interpreters
// Py_MOD_PER_INTERPRETER_GIL_SUPPORTED requires heaptypes
{Py_mod_multiple_interpreters, Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED},
#endif
#ifdef Py_mod_gil
{Py_mod_gil, Py_MOD_GIL_NOT_USED},
#endif
{0, NULL}
};

Expand Down
4 changes: 4 additions & 0 deletions Doc/includes/newtypes/custom3.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,13 @@ custom_module_exec(PyObject *mod)

static PyModuleDef_Slot custom_module_slots[] = {
{Py_mod_exec, custom_module_exec},
#ifdef Py_mod_multiple_interpreters
// Py_MOD_PER_INTERPRETER_GIL_SUPPORTED requires heaptypes
{Py_mod_multiple_interpreters, Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED},
#endif
#ifdef Py_mod_gil
{Py_mod_gil, Py_MOD_GIL_NOT_USED},
#endif
{0, NULL}
};

Expand Down
4 changes: 4 additions & 0 deletions Doc/includes/newtypes/custom4.c
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,13 @@ custom_module_exec(PyObject *mod)

static PyModuleDef_Slot custom_module_slots[] = {
{Py_mod_exec, custom_module_exec},
#ifdef Py_mod_multiple_interpreters
// Py_MOD_PER_INTERPRETER_GIL_SUPPORTED requires heaptypes
{Py_mod_multiple_interpreters, Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED},
#endif
#ifdef Py_mod_gil
{Py_mod_gil, Py_MOD_GIL_NOT_USED},
#endif
{0, NULL}
};

Expand Down
4 changes: 4 additions & 0 deletions Doc/includes/newtypes/sublist.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,13 @@ sublist_module_exec(PyObject *mod)

static PyModuleDef_Slot sublist_module_slots[] = {
{Py_mod_exec, sublist_module_exec},
#ifdef Py_mod_multiple_interpreters
// Py_MOD_PER_INTERPRETER_GIL_SUPPORTED requires heaptypes
{Py_mod_multiple_interpreters, Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED},
#endif
#ifdef Py_mod_gil
{Py_mod_gil, Py_MOD_GIL_NOT_USED},
#endif
{0, NULL}
};

Expand Down