Skip to content

Commit e7e102a

Browse files
committed
Respond to reviews
1 parent 30d97b1 commit e7e102a

File tree

4 files changed

+23
-15
lines changed

4 files changed

+23
-15
lines changed

Doc/c-api/module.rst

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -685,10 +685,11 @@ remove it.
685685
Usually, there is only one variable of this type for each extension module
686686
defined this way.
687687
688-
In the :ref:`Stable ABI <stable-abi>` for free-threaded builds (``abi3t``),
689-
this struct is opaque, and unusable in practice.
690-
The struct, including all members, is part of Stable ABI for
691-
non-free-threaded builds (``abi3``).
688+
The struct, including all members, is part of the
689+
:ref:`Stable ABI <stable-abi>` for non-free-threaded builds (``abi3``).
690+
In the Stable ABI for free-threaded builds (``abi3t``),
691+
this struct is opaque, and unusable in practice; see :ref:`pymoduledef_slot`
692+
for a replacement.
692693

693694
.. c:member:: PyModuleDef_Base m_base
694695
@@ -700,10 +701,10 @@ remove it.
700701
701702
The type of :c:member:`!PyModuleDef.m_base`.
702703

703-
In the :ref:`Stable ABI <stable-abi>` for Free-Threaded Builds
704-
(``abi3t``), this struct is opaque, and unusable in practice.
705-
The struct is part of Stable ABI for
704+
The struct is part of the :ref:`Stable ABI <stable-abi>` for
706705
non-free-threaded builds (``abi3``).
706+
In the Stable ABI for Free-Threaded Builds
707+
(``abi3t``), this struct is opaque, and unusable in practice.
707708

708709
.. c:macro:: PyModuleDef_HEAD_INIT
709710

Doc/c-api/stable.rst

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,11 @@ Compiling for Stable ABI
125125

126126
.. note::
127127

128-
When using a build tool (for example, Setuptools), the tool is
129-
generally responsible for setting macros and synchronizing them with
130-
extension filenames and other metadata.
131-
Prefer using the tool's options over defining the macros manually.
128+
Build tools (such as, for example, meson-python, scikit-build-core,
129+
or Setuptools) often have a mechanism for setting macros and synchronizing
130+
them with extension filenames and other metadata.
131+
Prefer using such a mechanism, if it exists, over defining the
132+
macros manually.
132133

133134
The rest of this section is mainly relevant for tool authors, and for
134135
people who compile extensions manually.
@@ -150,10 +151,12 @@ For reference, the values for a few recent Python versions are:
150151

151152
.. version-hex-cheatsheet::
152153

153-
When the macro(s) are defined, ``Python.h`` will only expose API that is
154+
When one of the macros is defined, ``Python.h`` will only expose API that is
154155
compatible with the given Stable ABI -- that is, the
155156
:ref:`Limited API <limited-api-list>` plus some definitions that need to be
156157
visible to the compiler but should not be used directly.
158+
When both are defined, ``Python.h`` will only expose API compatible with
159+
both Stable ABIs.
157160

158161
.. c:macro:: Py_LIMITED_API
159162
@@ -186,7 +189,10 @@ defaults to the value of :c:macro:`!Py_TARGET_ABI3T`.
186189
This means that there are two ways to build for both ``abi3`` and ``abi3t``:
187190

188191
- define both :c:macro:`!Py_LIMITED_API` and :c:macro:`!Py_TARGET_ABI3T`, or
189-
- define only :c:macro:`!Py_LIMITED_API` and build for free-threaded Python.
192+
- define only :c:macro:`!Py_LIMITED_API` and:
193+
194+
- on Windows, define :c:macro:`!Py_GIL_DISABLED`;
195+
- on other systems, use the headers of free-threaded build of Python.
190196

191197

192198
.. _limited-api-scope-and-performance:

Doc/tools/extensions/c_annotations.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,7 @@ class VersionHexCheatsheet(SphinxDirective):
380380
It should auto-update with the version being documented, so it must be an
381381
extension.
382382
"""
383+
383384
has_content = False
384385
required_arguments = 0
385386
optional_arguments = 0

Doc/whatsnew/3.15.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -409,8 +409,8 @@ the existing Stable ABI (``abi3``) and the version-specific ABI for
409409
free-threading (``cp315t``) separately.
410410

411411
Stable ABI for Free-Threaded Builds should typically
412-
be selected in a build tool (such as Setuptools, meson-python, Cython,
413-
scikit-build-core, Maturin).
412+
be selected in a build tool (such as, for example, Setuptools, meson-python,
413+
scikit-build-core, or Maturin).
414414
At the time of writing, these tools did **not** support ``abi3t``.
415415
If this is the case for your tool, compile for ``cp315t`` separately.
416416
If not using a build tool -- or when writing such a tool -- you can select

0 commit comments

Comments
 (0)