Skip to content

PEP 803: Stable ABI for Free-Threaded Builds #4556

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

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
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.

3 participants