Skip to content

Conversation

encukou
Copy link
Member

@encukou encukou commented Aug 19, 2025

Basic requirements (all PEP Types)

  • Read and followed PEP 1 & PEP 12
  • File created from the latest PEP template (almost)
  • PEP has next available number, & set in filename (pep-NNNN.rst), PR title (PEP 123: <Title of PEP>) and PEP header
  • Title clearly, accurately and concisely describes the content in 79 characters or less
  • Core dev/PEP editor listed as Author or Sponsor, and formally confirmed their approval
  • Author, Status (Draft), Type and Created headers filled out correctly
  • PEP-Delegate, Topic, Requires and Replaces headers completed if appropriate
  • Required sections included
    • Abstract (first section)
    • Copyright (last section; exact wording from template required)
  • Code is well-formatted (PEP 7/PEP 8) and is in code blocks, with the right lexer names if non-Python
  • PEP builds with no warnings, pre-commit checks pass and content displays as intended in the rendered HTML
  • Authors/sponsor added to .github/CODEOWNERS for the PEP

Standards Track requirements

  • PEP topic discussed in a suitable venue with general agreement that a PEP is appropriate
  • Suggested sections included (unless not applicable)
    • Motivation
    • Rationale
    • Specification
    • Backwards Compatibility
    • Security Implications
    • How to Teach This
    • Reference Implementation
    • Rejected Ideas
    • Open Issues
  • Python-Version set to valid (pre-beta) future Python version, if relevant
  • Any project stated in the PEP as supporting/endorsing/benefiting from the PEP formally confirmed such
  • Right before or after initial merging, PEP discussion thread created and linked to in Discussions-To and Post-History

📚 Documentation preview 📚: https://pep-previews--4556.org.readthedocs.build/

@encukou encukou requested a review from a team as a code owner August 19, 2025 15:02
Copy link
Member

@JelleZijlstra JelleZijlstra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, some small comment.

Copy link
Contributor

@willingc willingc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @encukou. I've made a few readability suggestions.

that is, only a subset of the functions, structures, etc. that CPython
exposes.
The limited API is versioned, and building against Limited API 3.X
yields an extension that is ABI-compatible with CPython 3.X *and above* (modulo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what "modulo bugs" means in this sentence.

Comment on lines +174 to +176
However, CPython will add a line of defense against outdated or misconfigured
tools, or human mistakes, in the form of a new *module slot* containing
basic ABI information.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
However, CPython will add a line of defense against outdated or misconfigured
tools, or human mistakes, in the form of a new *module slot* containing
basic ABI information.
However, CPython will help defend against outdated or misconfigured
tools, or human mistakes, in the form of a new *module slot* containing
basic ABI information.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think my wording better suggests that we're adding a distinct mechanism.

Comment on lines +177 to +178
This information will be checked when a module is loaded, and incompatible
extensions will be rejected.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This information will be checked when a module is loaded, and incompatible
extensions will be rejected.
Checks will be done when a module is loaded, and incompatible
extensions will be rejected.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to say which information is checked (with “this” referring to the previous sentence).

Copy link
Member Author

@encukou encukou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the reviews!

Sometimes I have reasons for a particular wording, and copy editing helps make the nuances stand out :)

Projects that need this can build separate extensions specifically for
the 3.14 free-threaded interpreter, and for older stable ABI versions.

API changes are OK
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's what the next sentence says. Do you think the 4 words don't make sense as a heading?

Comment on lines +177 to +178
This information will be checked when a module is loaded, and incompatible
extensions will be rejected.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to say which information is checked (with “this” referring to the previous sentence).

Comment on lines +174 to +176
However, CPython will add a line of defense against outdated or misconfigured
tools, or human mistakes, in the form of a new *module slot* containing
basic ABI information.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think my wording better suggests that we're adding a distinct mechanism.

Comment on lines +168 to +170
Users -- or rather the tools they use for building and installing extensions --
will continue to be responsible for not putting incompatible extensions on
Python's import paths.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tools can only be responsible for their own actions; they're not expected to prevent anything else from messing things up.

- :c:type:`!PyModuleDef_Base`
- :c:type:`PyModuleDef`

- no longer include the following macros:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to keep the current wording if you don't mind.
AFAIK, “exclude” sounds more like “prevent from being included” or “expel” than a passive “not include”. (And a few dictionaries I checked at least put the definitions in this order.)

Co-authored-by: Carol Willing <[email protected]>
Co-authored-by: Jelle Zijlstra <[email protected]>
@AA-Turner AA-Turner self-requested a review August 21, 2025 22:22
@encukou
Copy link
Member Author

encukou commented Aug 26, 2025

@AA-Turner, are you working on a review?

@AA-Turner
Copy link
Member

Yes, sorry for the delay. I've been unexpectedly busy, should have it finished by Thursday.

A

@encukou
Copy link
Member Author

encukou commented Aug 29, 2025

Please send what you have, or leave it for the next round. I'd like to publish the PEP next week.

Copy link
Member

@AA-Turner AA-Turner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the delay Petr, I've written up the notes I had & done a brief editorial/style pass.

A

@@ -0,0 +1,322 @@
PEP: 803
Title: Stable ABI for Free-Threaded Builds
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to clarify that this is for CPython?

Status: Draft
Type: Standards Track
Requires: 703, 793, 697
Created: 08-Aug-2025
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the date of formal number assignment

Suggested change
Created: 08-Aug-2025
Created: 19-Aug-2025


Stable ABI 3.15 will be compatible with both free-threaded and GIL-enabled
builds.
To allow this, the ``PyObject`` internal structure and related APIs
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
To allow this, the ``PyObject`` internal structure and related APIs
To allow this, the :c:type:`PyObject` internal structure and related APIs

Comment on lines +15 to +16
Stable ABI 3.15 will be compatible with both free-threaded and GIL-enabled
builds.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Grammar, this reads slightly oddly to me. Perhaps "Version 3.15 of the Stable ABI will be ...", or "The Stable ABI version 3.15 will be ..."?

Stable ABI 3.15 will be compatible with both free-threaded and GIL-enabled
builds.
To allow this, the ``PyObject`` internal structure and related APIs
will be removed from the Limited API, requiring migration to new API
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume removed only for the 3.15 / 0x030F0000 version level, rather than entirely?

Comment on lines +157 to +158
New Export Hook (PEP 793)
-------------------------
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
New Export Hook (PEP 793)
-------------------------
New Export Hook (:pep:`793`)
----------------------------


The following functions will become unusable in practice (in the new Limited
API), since an extension cannot create valid, statically allocated, input
for them. To ease the transition for extension developers, they will not yet be removed from the Limited API:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line length (please stick to 79)


This slot will become *mandatory* with the new export hook added in
:pep:`793`.
(The PEP currently says “there are no required slots”; it will be updated.)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
(The PEP currently says “there are no required slots”; it will be updated.)
(That PEP currently says “there are no required slots”; it will be updated.)


- Opaque ``PyObject`` is available in CPython main branch after defining the
``_Py_OPAQUE_PYOBJECT`` macro.
Implemented in GitHub pull request `#136505 <https://github.com/python/cpython/pull/136505>`__.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Implemented in GitHub pull request `#136505 <https://github.com/python/cpython/pull/136505>`__.
Implemented in GitHub pull request `python/cpython#136505
<https://github.com/python/cpython/pull/136505>`__.

Comment on lines +262 to +263
- For a version-checking slot, see GitHub pull request `#137212 <https://github.com/python/cpython/pull/137212>`__.
- For a check for older ``abi3``, see GitHub pull request `#137957 <https://github.com/python/cpython/pull/137957>`__.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- For a version-checking slot, see GitHub pull request `#137212 <https://github.com/python/cpython/pull/137212>`__.
- For a check for older ``abi3``, see GitHub pull request `#137957 <https://github.com/python/cpython/pull/137957>`__.
- For a version-checking slot, see GitHub pull request `python/cpython#137212
<https://github.com/python/cpython/pull/137212>`__.
- For a check for older ``abi3``, see GitHub pull request `python/cpython#137957
<https://github.com/python/cpython/pull/137957>`__.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants