Skip to content

Commit fcd2fe2

Browse files
encukouAA-Turner
andauthored
Apply suggestions from code review
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
1 parent f223ba1 commit fcd2fe2

File tree

1 file changed

+25
-15
lines changed

1 file changed

+25
-15
lines changed

peps/pep-0803.rst

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@ Discussions-To: Pending
55
Status: Draft
66
Type: Standards Track
77
Requires: 703, 793, 697
8-
Created: 08-Aug-2025
8+
Created: 19-Aug-2025
99
Python-Version: 3.15
1010

1111

1212
Abstract
1313
========
1414

15-
Stable ABI 3.15 will be compatible with both free-threaded and GIL-enabled
16-
builds.
17-
To allow this, the ``PyObject`` internal structure and related APIs
18-
will be removed from the Limited API, requiring migration to new API
15+
Version 3.15 of the Stable ABI will be compatible with both free-threaded and
16+
GIL-enabled builds.
17+
To allow this, the :c:type:`PyObject` internal structure and related APIs
18+
will be removed from version 3.15 of the Limited API, requiring migration to new API
1919
for common tasks like defining modules and most classes.
2020

2121

@@ -29,6 +29,11 @@ that is, an interpreter or extension built without ``Py_GIL_DISABLED``.
2929
Motivation
3030
==========
3131

32+
The Stable ABI is currently not available for free-threaded builds.
33+
Extensions will fail to build when :c:macro:`Py_LIMITED_API` is defined,
34+
and extensions built for GIL-enabled builds of CPython will fail to load (or crash)
35+
on free-threaded builds.
36+
3237
In its `acceptance post <https://discuss.python.org/t/84319/123>`__
3338
for :pep:`779`, the Steering Council stated that it “expects that Stable ABI
3439
for free-threading should be prepared and defined for Python 3.15”.
@@ -42,9 +47,10 @@ Background
4247
Python's Stable ABI, as defined in :pep:`384` and :pep:`652`, provides a way to
4348
compile extension modules that can be loaded on multiple versions of the
4449
CPython interpreter.
45-
Several projects use this to limit the number of *wheels* (binary artefacts)
50+
Several projects use this to limit the number of
51+
:ref:`wheels <packaging:binary-distribution-format>` (binary artefacts)
4652
that need to be built and distributed for each release, and/or to make it
47-
possible to test with pre-release versions of Python.
53+
easier to test with pre-release versions of Python.
4854

4955
With free-threading builds (:pep:`703`) being on track to eventually become
5056
the default (:pep:`779`), we need a way to make the Stable ABI available
@@ -124,7 +130,7 @@ Implications
124130
Making the ``PyObject``, ``PyVarObject`` and ``PyModuleDef`` structures
125131
opaque means:
126132

127-
- Their fields may not be accessed.
133+
- Their fields may not be directly accessed.
128134

129135
For example, instead of ``o->ob_type``, extensions must use
130136
``Py_TYPE(o)``.
@@ -147,15 +153,16 @@ opaque means:
147153

148154
The following functions will become unusable in practice (in the new Limited
149155
API), since an extension cannot create valid, statically allocated, input
150-
for them. To ease the transition for extension developers, they will not yet be removed from the Limited API:
156+
for them. To ease the transition for extension developers,
157+
they will not yet be removed from the Limited API:
151158

152159
- :c:func:`PyModuleDef_Init`
153160
- :c:func:`PyModule_Create`, :c:func:`PyModule_Create2`
154161
- :c:func:`PyModule_FromDefAndSpec`, :c:func:`PyModule_FromDefAndSpec2`
155162

156163

157-
New Export Hook (PEP 793)
158-
-------------------------
164+
New Export Hook (:pep:`793`)
165+
----------------------------
159166

160167
Implementation of this PEP requires :pep:`793` (``PyModExport``:
161168
A new entry point for C extension modules) to be
@@ -182,7 +189,7 @@ The specifics are left to the C API working group
182189

183190
This slot will become *mandatory* with the new export hook added in
184191
:pep:`793`.
185-
(The PEP currently says “there are no required slots”; it will be updated.)
192+
(That PEP currently says “there are no required slots”; it will be updated.)
186193

187194

188195
Check for older ``abi3``
@@ -257,10 +264,13 @@ This PEP combines several pieces, implemented individually:
257264

258265
- Opaque ``PyObject`` is available in CPython main branch after defining the
259266
``_Py_OPAQUE_PYOBJECT`` macro.
260-
Implemented in GitHub pull request `#136505 <https://github.com/python/cpython/pull/136505>`__.
267+
Implemented in GitHub pull request `python/cpython#136505
268+
<https://github.com/python/cpython/pull/136505>`__.
261269
- For ``PyModExport``, see :pep:`793`.
262-
- For a version-checking slot, see GitHub pull request `#137212 <https://github.com/python/cpython/pull/137212>`__.
263-
- For a check for older ``abi3``, see GitHub pull request `#137957 <https://github.com/python/cpython/pull/137957>`__.
270+
- For a version-checking slot, see GitHub pull request `python/cpython#137212
271+
<https://github.com/python/cpython/pull/137212>`__.
272+
- For a check for older ``abi3``, see GitHub pull request `python/cpython#137957
273+
<https://github.com/python/cpython/pull/137957>`__.
264274
- For wheel tags, there is no implementation yet.
265275
- A porting guide is not yet written.
266276

0 commit comments

Comments
 (0)