Skip to content

Commit b3799de

Browse files
committed
Address review
1 parent 2372da9 commit b3799de

File tree

3 files changed

+17
-13
lines changed

3 files changed

+17
-13
lines changed

Doc/c-api/module.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -685,7 +685,7 @@ 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``),
688+
In the :ref:`Stable ABI <stable-abi>` for free-threaded builds (``abi3t``),
689689
this struct is opaque, and unusable in practice.
690690
The struct, including all members, is part of Stable ABI for
691691
non-free-threaded builds (``abi3``).

Doc/c-api/stable.rst

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,10 @@ versions of Python, without recompilation.
6868
There are two Stable ABIs:
6969

7070
- ``abi3``, introduced in Pyton 3.2, is compatible with
71-
**non**-:term:`free threaded <free-threaded build>` builds of CPython.
71+
**non**-:term:`free-threaded <free-threaded build>` builds of CPython.
7272

7373
- ``abi3t``, introduced in Pyton 3.15, is compatible with
74-
:term:`free threaded <free-threaded build>` builds of CPython.
74+
:term:`free-threaded <free-threaded build>` builds of CPython.
7575
It has stricter API limitations than ``abi3``.
7676

7777
.. versionadded:: next
@@ -99,8 +99,8 @@ This library only exposes the relevant symbols.
9999

100100
On some platforms, Python will look for and load shared library files named
101101
with the ``abi3`` or ``abi3t`` tag (for example, ``mymodule.abi3.so``).
102-
:term:`Free threaded <free-threaded build>` interpreters only recognize the
103-
``abi3t`` tag, while non-free threaded ones will prefer ``abi3`` but fall back
102+
:term:`Free-threaded <free-threaded build>` interpreters only recognize the
103+
``abi3t`` tag, while non-free-threaded ones will prefer ``abi3`` but fall back
104104
to ``abi3t``.
105105
Thus, extensions compatible with both ABIs should use the ``abi3t`` tag.
106106

@@ -158,13 +158,13 @@ visible to the compiler but should not be used directly.
158158
.. c:macro:: Py_LIMITED_API
159159
160160
Target ``abi3``, that is,
161-
non-:term:`free threaded <free-threaded build>` builds of CPython.
161+
non-:term:`free-threaded <free-threaded build>` builds of CPython.
162162
See :ref:`above <abi3-compiling>` for common information.
163163

164164
.. c:macro:: Py_TARGET_ABI3T
165165
166166
Target ``abi3t``, that is,
167-
:term:`free threaded <free-threaded build>` builds of CPython.
167+
:term:`free-threaded <free-threaded build>` builds of CPython.
168168
See :ref:`above <abi3-compiling>` for common information.
169169

170170
.. versionadded:: next
@@ -189,6 +189,8 @@ This means that there are two ways to build for both ``abi3`` and ``abi3t``:
189189
- define only :c:macro:`!Py_LIMITED_API` and build for free-threaded Python.
190190

191191

192+
.. _limited-api-scope-and-performance:
193+
192194
Stable ABI Scope and Performance
193195
--------------------------------
194196

@@ -215,6 +217,8 @@ alongside a version compiled for Stable ABI -- a slower but more compatible
215217
fallback.
216218

217219

220+
.. _limited-api-caveats:
221+
218222
Stable ABI Caveats
219223
------------------
220224

@@ -224,7 +228,6 @@ Stable ABI prevents *ABI* issues, like linker errors due to missing
224228
symbols or data corruption due to changes in structure layouts or function
225229
signatures.
226230
However, other changes in Python can change the *behavior* of extensions.
227-
See Python's Backwards Compatibility Policy (:pep:`387`) for details.
228231

229232
One issue that the :c:macro:`Py_TARGET_ABI3T` and :c:macro:`Py_LIMITED_API`
230233
macros do not guard against is calling a function with arguments that are

Doc/whatsnew/3.15.rst

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -390,28 +390,29 @@ agen() for x in a)``.
390390
C extensions that target the :ref:`Stable ABI <stable-abi>` can now be
391391
compiled for the new *Stable ABI for Free-Threaded Builds* (also known
392392
as ``abi3t``), which makes them compatible with
393-
:term:`free-threaded build <free-threaded build>` builds of CPython.
393+
:term:`free-threaded <free-threaded build>` builds of CPython.
394394
This usually requires some non-trivial changes to the source code;
395395
specifically:
396396

397397
- Switching to API introduced in :pep:`697` (Python 3.12), such as
398-
negative :c:member:`~PyType_Spec.basicsize`
398+
negative :c:member:`~PyType_Spec.basicsize` and
399399
:c:func:`PyObject_GetTypeData`, rather than making :c:type:`PyObject`
400400
part of the instance struct; and
401401
- Switching from a ``PyInit_`` function to a new export hook,
402402
:c:func:`PyModExport_* <PyModExport_modulename>`, introduced for this
403403
purpose in :pep:`793`.
404404

405-
Note that Stable ABI does not offer all functionality CPython has to offer.
405+
Note that Stable ABI does not offer all the functionality that CPython
406+
has to offer.
406407
Extensions that cannot switch to ``abi3t`` should continue to build for
407408
the existing Stable ABI (``abi3``) and the version-specific ABI for
408409
free-threading (``cp315t``) separately.
409410

410411
Stable ABI for Free-Threaded Builds should typically
411-
be selected in a build tool (such as Setuptools, ``meson-python``, Cython,
412+
be selected in a build tool (such as Setuptools, meson-python, Cython,
412413
Scikit-build-core, Maturin, and similar).
413414
At the time of writing this entry, these tools did **not** support ``abi3t``.
414-
If this is the case for "your" tool, compile for ``cp315t`` separately.
415+
If this is the case for your tool, compile for ``cp315t`` separately.
415416
If not using a build tool -- or when writing such a tool -- you can select
416417
``abi3t`` by setting the macro :c:macro:`!Py_TARGET_ABI3T` as discussed
417418
in :ref:`abi3-compiling`.

0 commit comments

Comments
 (0)