-
-
Notifications
You must be signed in to change notification settings - Fork 30.3k
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
Subclasses of ExceptionGroup
can wrap BaseException
s
#99553
Comments
I believe we discussed this and decided that we leave it to the subclass author to deal with it. Maybe it needs to be documented (or reconsidered)? CC @gvanrossum @1st1 |
I think at least documented, though I'd prefer it was changed. If people intend The |
Hah! It looks like I just find this persistently startling: #28569 (comment) (but I promise, no PEP this time 😉) |
Yeah, I definitely recall that we discussed this before. But looking at the code it's possible that we were too conservative. In particular in the fallback clause we could have chosen to check if The thing we definitely can't do is adjusting the class if it is exactly The question is, can we treat this as a bug and fix it (in 3.11.1 if it isn't out yet) or would such a fix be considered backwards compatible? |
I think we can call it a bug. It’s better to change it in 3.11.1 than in 3.12. |
Sounds good. |
…aseException (pythonGH-99572) (cherry picked from commit c8c6113) Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
(cherry picked from commit 4cd1cc8) Co-authored-by: Zac Hatfield-Dodds <zac.hatfield.dodds@gmail.com>
I believe that this is a bug tracing to the period when PEP-654 did not intend
(Base)ExceptionGroup
to be usable as a parent class; and I think a sufficient fix would be to replace the type-equality check with an isinstance check in:cpython/Objects/exceptions.c
Lines 740 to 744 in bc390dd
cc @iritkatriel; raised via agronholm/exceptiongroup#40 (comment)
Linked PRs
The text was updated successfully, but these errors were encountered: