Skip to content

Commit 7cbcf37

Browse files
committed
gh-149716: Document PySlot_DATA for Py_mod_gil and Py_mod_multiple_interpreters
Add short code examples mirroring the existing Py_mod_abi example, so it is clear which slot definition macro (PySlot_DATA, PySlot_INT64, or PySlot_UINT64) to use for these two slots.
1 parent 68ebc05 commit 7cbcf37

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

Doc/c-api/module.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,14 @@ Feature slots
247247
If ``Py_mod_multiple_interpreters`` is not specified, the import
248248
machinery defaults to ``Py_MOD_MULTIPLE_INTERPRETERS_SUPPORTED``.
249249
250+
A suitable slot value can be defined using the :c:macro:`PySlot_DATA` macro,
251+
as in:
252+
253+
.. code-block:: c
254+
255+
PySlot_DATA(Py_mod_multiple_interpreters,
256+
Py_MOD_PER_INTERPRETER_GIL_SUPPORTED)
257+
250258
.. versionadded:: 3.12
251259
252260
.. c:macro:: Py_mod_gil
@@ -272,6 +280,13 @@ Feature slots
272280
If ``Py_mod_gil`` is not specified, the import machinery defaults to
273281
``Py_MOD_GIL_USED``.
274282
283+
A suitable slot value can be defined using the :c:macro:`PySlot_DATA` macro,
284+
as in:
285+
286+
.. code-block:: c
287+
288+
PySlot_DATA(Py_mod_gil, Py_MOD_GIL_NOT_USED)
289+
275290
.. versionadded:: 3.13
276291
277292

0 commit comments

Comments
 (0)