gh-107305: Update the C-API Docs for PEP 684#107324
gh-107305: Update the C-API Docs for PEP 684#107324ericsnowcurrently merged 14 commits intopython:mainfrom
Conversation
Doc/c-api/init.rst
Outdated
| This determines the operation of the GIL for the sub-interpreter. | ||
| It may be one of the following: | ||
|
|
||
| - ``PyInterpreterConfig_DEFAULT_GIL``: use the default selection |
There was a problem hiding this comment.
You can use .. c:macro:: for declaring these constant and the :c:macro: role for referring them. They will also be added in the index.
Just add .. c:namespace:: NULL before this, otherwise they will have wrong prefix.
Doc/c-api/init.rst
Outdated
| Otherwise it will use (share) the main interpreter's. | ||
|
|
||
| If this is ``0`` then | ||
| :c:member:`PyInterpreterConfig.check_multi_interp_extensions` |
There was a problem hiding this comment.
Perhaps :c:member:`~PyInterpreterConfig.check_multi_interp_extensions` or just :c:member:`check_multi_interp_extensions` would look better.
Doc/c-api/init.rst
Outdated
| :c:member:`PyInterpreterConfig.use_main_obmalloc` must be ``0``. | ||
|
|
||
|
|
||
| .. c:function:: PyThreadState* Py_NewInterpreterFromConfig(PyInterpreterConfig *config) |
There was a problem hiding this comment.
If config is not modified, perhaps add const?
Doc/c-api/init.rst
Outdated
| .. index:: single: close() (in module os) | ||
|
|
||
|
|
||
| .. c:function:: PyThreadState* Py_NewInterpreter() |
There was a problem hiding this comment.
| .. c:function:: PyThreadState* Py_NewInterpreter() | |
| .. c:function:: PyThreadState* Py_NewInterpreter(void) |
Doc/c-api/init.rst
Outdated
| If this is ``0`` then | ||
| :c:member:`~PyInterpreterConfig.check_multi_interp_extensions` | ||
| must be ``1`` (non-zero). | ||
| If this is ``1`` then :c:member:`PyInterpreterConfig.gil` |
There was a problem hiding this comment.
I think the prefix can be omitted here too.
Doc/c-api/init.rst
Outdated
| including legacy (single-phase init) modules, | ||
| in any thread where the sub-interpreter is currently active. | ||
| Otherwise only multi-phase init extension modules | ||
| (see :ref:`Isolating Extension Modules`) may be imported. |
There was a problem hiding this comment.
An explicit label is required to refer across files.
Doc/c-api/init.rst
Outdated
| The given config controls the options with which the interpreter | ||
| is initialized. | ||
|
|
||
| Upon success, the ``tstate_p`` arg will be set to the first thread state |
There was a problem hiding this comment.
Function parameters are marked like *tstate_p*.
serhiy-storchaka
left a comment
There was a problem hiding this comment.
The formatting LGTM.
|
Thanks @ericsnowcurrently for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12. |
|
Thanks for the reviews, @serhiy-storchaka |
|
GH-107402 is a backport of this pull request to the 3.12 branch. |
(cherry picked from commit c0b81c4) Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
📚 Documentation preview 📚: https://cpython-previews--107324.org.readthedocs.build/