gh-149716: Document PySlot_DATA for Py_mod_gil and Py_mod_multiple_interpreters#150053
Open
Taeknology wants to merge 1 commit into
Open
gh-149716: Document PySlot_DATA for Py_mod_gil and Py_mod_multiple_interpreters#150053Taeknology wants to merge 1 commit into
Taeknology wants to merge 1 commit into
Conversation
…ple_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.
Documentation build overview
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #149716.
Summary
Adds short code examples to the documentation of two module slot IDs
(
Py_mod_gilsince 3.13,Py_mod_multiple_interpreterssince 3.12).The examples mirror the existing one under
Py_mod_abiand make itexplicit that
PySlot_DATA(notPySlot_INT64/PySlot_UINT64)is the correct slot-definition macro for these two slots, because
their values (
Py_MOD_GIL_*,Py_MOD_MULTIPLE_INTERPRETERS_*,Py_MOD_PER_INTERPRETER_GIL_SUPPORTED) are defined as(void *)Nin
Include/moduleobject.h, andPySlot_DATAcasts tovoid *(
Include/slots.h).Changes
Doc/c-api/module.rst: add aPySlot_DATA(...)code-block to eachof the two slot sections, in the same 4-part style (intro sentence +
.. code-block:: c+ 6-space code +.. versionadded::) as theexisting
Py_mod_abiexample.The
Py_mod_multiple_interpretersexample showsPy_MOD_PER_INTERPRETER_GIL_SUPPORTED(rather than the default_SUPPORTED) since that is the value extension authors most often needto set explicitly. Likewise the
Py_mod_gilexample showsPy_MOD_GIL_NOT_USED(rather than the default_USED).Notes
Misc/NEWS.dentry per thedevguide.
Py_mod_abibyte-for-byte (3-space bodyindentation, 6-space code indentation, identical directive order).