Skip to content

PEP 780: Address review feedback on whitespace, type, and serialization - #5242

Merged
rgommers merged 2 commits into
python:mainfrom
zklaus:pep-780-thread-feedback
Nov 26, 2026
Merged

rgommers merged 2 commits into
python:mainfrom
zklaus:pep-780-thread-feedback

Conversation

@zklaus

@zklaus zklaus commented Nov 23, 2026

Copy link
Copy Markdown
Contributor
  • Change is either:
    • To a Draft PEP
    • To an Accepted or Final PEP, with Steering Council approval
    • To fix an editorial issue (markup, typo, link, header, etc)
  • PR title prefixed with PEP number (e.g. PEP 123: Summary of changes)

Follow-up to #4608, addressing feedback from the
discussion thread and findings from
updating the reference implementation.

  • Whitespace: specify that spaces and tabs adjacent to the :: separator
    are ignored in strings tested against sys_abi_info, and that everything
    else is compared as an opaque string. A non-matching string is absent from
    the set, not an error.
  • Type: declare the marker's type as Set of strings in the marker table
    and refer to the existing rules for such fields. Replace "frozen set" with
    "set".
  • Unsupported types: clarify that a required feature whose sys.abi_info
    field has an unsupported type falls back to the rules for older
    interpreters.
  • Serialized marker environments: new subsection in Backwards
    Compatibility. sys_abi_info is the first non-string value in the default
    marker environment, which affects tools that serialize it (pip inspect,
    pip install --report, pdm info --env) and tools that probe a target
    interpreter (tox). Recommends a sorted JSON array of the strings.

The reference implementation (packaging, patched pip, demo package) has been
updated to match.

Assisted-by: Claude Code:claude-fable-5-2

- Specify the handling of whitespace in strings tested against
  sys_abi_info: spaces and tabs adjacent to the "::" separator are
  ignored, everything else is compared as an opaque string.
- Declare the marker's type as "Set of strings" and refer to the existing
  rules for such fields; drop the "frozen set" wording.
- Clarify that a required feature whose sys.abi_info field has an
  unsupported type falls back to the rules for older interpreters.
- Add a section on serialized marker environments, recommending a sorted
  JSON array and discussing tools that probe a target interpreter.

Assisted-by: Claude Code:claude-fable-5-2
@read-the-docs-community

read-the-docs-community Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Documentation build overview

📚 pep-previews | 🛠️ Build #36185201 | 📁 Comparing 1bad750 against latest (4434e72)

  🔍 Preview build  

1 file changed
± pep-0780/index.html

@rgommers
rgommers self-requested a review November 23, 2026 16:16
@zklaus
zklaus marked this pull request as ready for review November 24, 2026 12:33
@zklaus
zklaus requested a review from lysnikolaou as a code owner November 24, 2026 12:33

@rgommers rgommers left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks @zklaus. This largely looks good to me. Regarding the new "Serialized Marker Environments" section under Backwards compatibility, that looks fine there but needs an actual conclusion about backwards compatibility. And it forgot consumers (e.g., PEX, which is worth a mention here) I propose, in analogy to the section below it:

Tools that serialize marker environments may lose functionality until they implement support for set-valued marker fields.

EDIT: I didn't find evidence of those serialized envs being passed between tools, so from that perspective this is all minor.

Comment thread peps/pep-0780.rst Resolved
- Replace the normative SHOULD in the Backwards Compatibility section
  with a recommendation.
- Mention Pex as a tool that both writes and reads serialized marker
  environments.
- Add a concluding statement on the compatibility impact for tools
  that produce or consume serialized marker environments.

Assisted-by: Claude Code:claude-fable-5-2
@zklaus
zklaus requested a review from rgommers November 26, 2026 10:28

@rgommers rgommers left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

That addressed the open comments. LGTM now, thanks @zklaus!

@rgommers
rgommers merged commit 659db60 into python:main Nov 26, 2026
5 checks passed
@rgommers rgommers mentioned this pull request Nov 26, 2026
3 of 4 tasks
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