Skip to content

PEP 785: New methods for easier handling of ExceptionGroups #4357

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

Merged
merged 4 commits into from
Apr 13, 2025

Conversation

Zac-HD
Copy link
Contributor

@Zac-HD Zac-HD commented Apr 9, 2025

I've discussed this fairly extensively with @gpshead, and we've been using related functions at work for some time now. I'm therefore posting the PR now to get the process rolling; I also expect to polish the prose (especially the footnotes) a little further before merging.

Basic requirements (all PEP Types)

  • Read and followed PEP 1 & PEP 12
  • File created from the latest PEP template
  • PEP has next available number, & set in filename (pep-NNNN.rst), PR title (PEP 123: <Title of PEP>) and PEP header
    (apologies for the intitial confusion here)
  • 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
      (none identified)
    • How to Teach This
    • Reference Implementation
    • Rejected Ideas
    • Open Issues
      (none identified)
  • 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--4357.org.readthedocs.build/

@Zac-HD Zac-HD requested a review from a team as a code owner April 9, 2025 05:02
@python-cla-bot

This comment was marked as resolved.

@Zac-HD Zac-HD force-pushed the handling-groups branch 2 times, most recently from 2645fb7 to 6656d1f Compare April 9, 2025 05:19
@JelleZijlstra
Copy link
Member

Why not use the next available number (785)?

@Zac-HD
Copy link
Contributor Author

Zac-HD commented Apr 9, 2025

Why not use the next available number (785)?

Because I've also got PEP-789, and I was worried about getting them mixed up in conversation 😅

@hugovk hugovk changed the title PEP-790: New methods for easier handling of ExceptionGroups PEP 790: New methods for easier handling of ExceptionGroups Apr 9, 2025
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.

Overall looks good, left some feedback inline.

hugovk

This comment was marked as resolved.

@Zac-HD Zac-HD force-pushed the handling-groups branch from 6656d1f to 81b3ffb Compare April 9, 2025 20:42
@AA-Turner
Copy link
Member

Why not use the next available number (785)?

Because I've also got PEP-789, and I was worried about getting them mixed up in conversation 😅

From PEP 1:

NNNN should be the next available PEP number not used by a published or in-PR PEP.

I don't have strong feelings, but I think we should encourage authors to keep PEP numbers in order, we've had recent confusion with gaps etc in the assigned numbers (777, 789).

A

@AA-Turner AA-Turner added the new-pep A new draft PEP submitted for initial review label Apr 9, 2025
@AA-Turner AA-Turner changed the title PEP 790: New methods for easier handling of ExceptionGroups PEP 790: New methods for easier handling of ExceptionGroups Apr 9, 2025
@hugovk
Copy link
Member

hugovk commented Apr 9, 2025

I don't have strong feelings, but I think we should encourage authors to keep PEP numbers in order, we've had recent confusion with gaps etc in the assigned numbers (777, 789).

I agree, we don't want authors jumping to the next tens if they already have a PEP in the current one, it'll be tricky to defrag (and we don't want to run out of integers 🙃).

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.

Initial brief review:

@AA-Turner
Copy link
Member

I don't have strong feelings, but I think we should encourage authors to keep PEP numbers in order, we've had recent confusion with gaps etc in the assigned numbers (777, 789).

I agree, we don't want authors jumping to the next tens if they already have a PEP in the current one, it'll be tricky to defrag (and we don't want to run out of integers 🙃).

This has again caused confusion, see #4365, where the author chose PEP 791 as the 'next' number.

@Zac-HD please could you renumber this PEP to 785, and then we can assign #4365 as PEP 786 (assuming it gets a sponsor)?

A

@hugovk hugovk changed the title PEP 790: New methods for easier handling of ExceptionGroups PEP 785: New methods for easier handling of ExceptionGroups Apr 12, 2025
@Zac-HD Zac-HD force-pushed the handling-groups branch 2 times, most recently from 125cb75 to c6f30fc Compare April 12, 2025 07:53
@Zac-HD
Copy link
Contributor Author

Zac-HD commented Apr 12, 2025

Thank you all for the reviews - I've fixed the PEP number, and also implemented the suggestions from first-pass review. (even deleting the second space after each period!)

Looking at the build failure, I don't think that's me - it hasn't even read that far yet:

reading sources... [ 28%] pep-0343 .. pep-0383

Sphinx parallel build error:
AttributeError: 'Values' object has no attribute 'env'
make: *** [Makefile:24: html] Error 2
reading sources... [ 33%] pep-0384 .. pep-0425

Co-authored-by: Hugo van Kemenade <[email protected]>
@hugovk
Copy link
Member

hugovk commented Apr 13, 2025

Ready to merge?

@Zac-HD
Copy link
Contributor Author

Zac-HD commented Apr 13, 2025

Did a final self-review and fixed some formatting and minor expression issues; I'm now ready to merge. Thanks again to everyone above!

@hugovk hugovk enabled auto-merge (squash) April 13, 2025 21:08
@hugovk
Copy link
Member

hugovk commented Apr 13, 2025

Hmm, GitHub says all comments must be resolved, but as far as I can see, they all are?

image

@gpshead gpshead dismissed AA-Turner’s stale review April 13, 2025 21:39

we believe all comments were addressed and github just isn't gettin' it.

@gpshead gpshead disabled auto-merge April 13, 2025 21:45
@gpshead gpshead enabled auto-merge (squash) April 13, 2025 21:45
@gpshead gpshead merged commit acacf08 into python:main Apr 13, 2025
5 checks passed
@gpshead
Copy link
Member

gpshead commented Apr 13, 2025

I used Claude Code to find the comments on the PR that GitHub refused to expose in its UI and make Github GraphQL API calls to mark them as resolved.

there were two stranded review comments unresolved from hugo 5 days ago that the force push'es had garbage collected from git so the github UI wouldn't allow you to see them from the files changes -> conversations view other than linking to broken links to them.

@gpshead
Copy link
Member

gpshead commented Apr 13, 2025

(if you're a claude user, ask it to use the gh command line and to use the github GraphQL API and it'll start figuring out the magic...)

@Zac-HD Zac-HD deleted the handling-groups branch April 13, 2025 22:32
@hugovk
Copy link
Member

hugovk commented Apr 14, 2025

@Zac-HD Please could you open a quick PR to add the discussion thread to Discussions-To and Post-History? Thank you!

@Zac-HD Zac-HD mentioned this pull request Apr 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new-pep A new draft PEP submitted for initial review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants