-
-
Notifications
You must be signed in to change notification settings - Fork 32k
added exception groups #25430
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
added exception groups #25430
Conversation
Lib/test/exception_hierarchy.txt
Outdated
+-- Exception | ||
+-- ExceptionGroup |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately we can't express here that ExceptionGroup subclasses BaseExceptionGroup as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a note in parentheses?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There seems to be an unused feature that interprets whatever is in "(..)" as a platform name and then ignores any exception where the platform is not the current platform (so it won't break the test but will weaken it).
But "[...]" seems ok - anything in them appears to be ignored, and when I changed ExceptionGroup to something invalid the test failed.
cpython/Lib/test/test_baseexception.py
Line 49 in 8bbfeb3
if '(' in exc_name: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this what we will merge once the PEP is accepted?
(Note that the master -> main rename will happen at that time too. But supposedly PSs will be automatically adjusted. We’ll see.)
Lib/test/exception_hierarchy.txt
Outdated
+-- Exception | ||
+-- ExceptionGroup |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a note in parentheses?
Probably mark as Draft? |
bbedd10
to
40c3cd0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this what we will merge once the PEP is accepted?
That's the idea. The branch of the other PR is very old and compile.c/eval.c changed beyond what can be fixed with a rebase. So I started from scratch on a recent cut of master. Marked as draft for now.
Lib/test/exception_hierarchy.txt
Outdated
+-- Exception | ||
+-- ExceptionGroup |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There seems to be an unused feature that interprets whatever is in "(..)" as a platform name and then ignores any exception where the platform is not the current platform (so it won't break the test but will weaken it).
But "[...]" seems ok - anything in them appears to be ignored, and when I changed ExceptionGroup to something invalid the test failed.
cpython/Lib/test/test_baseexception.py
Line 49 in 8bbfeb3
if '(' in exc_name: |
81b6b08
to
cecdf32
Compare
You should probably merge this on main. |
…ality which is needed for cycle detection and except*'s reraise logic
cecdf32
to
0a9e6b5
Compare
I rebased and regenerated Python/importlib_external.h |
This PR is stale because it has been open for 30 days with no activity. |
Superseded by #28569. |
First step of PEP-654: added Exception Groups (without updating traceback formatting).