Repository navigation
Documentation for except* clause and ExceptionGroup can be improved . #98172
Description
Activity
- added a commit that references this issue
on Oct 11, 2022 I opened #98173 to fix the formatting issue.
- changed the title
[-]except* clause and ExceptionGroup need more work.[/-][+]Documentation for except* clause and ExceptionGroup can be improved .[/+]on Oct 11, 2022 - added a commit that references this issue
on Oct 11, 2022 I fixed the formatting issue, thanks for pointing that out!
Your points about the substance of the docs remain. Feel free to submit a PR with improvements.
- added 2 commits that reference this issue
on Oct 14, 2022 For except*:
When the try body raises a single exception, not an ExceptionGroup, it will be handled by at most one handler (the first one that matches).
Agreed, I will add this.
The except* clause handles an exception group of all matching exceptions which were not already matched in an earlier except* clause.
This is already stated: "Each exception in the group is handled by at most one :keyword:
!except*clause, the first that matches it."Note that ExceptionGroup is a subclass of BaseExceptionGroup, and so cannot be the type in an except* clause.
I don't think this is needed here (this is a language reference, not a tutorial, and the exception hierarchy is documented).
ExceptionGroup extends both BaseExceptionGroup and Exception.
This is why BaseExceptionGroup is in square brackets after ExceptionGroup:
"ExceptionGroup [BaseExceptionGroup]"
This is a text diagram, not sure how else we could do it.
Thank you @mrolle45 .
- added a commit that references this issue
on Oct 22, 2022
except*
except * currently reads:
The following text appears in the same box as the example code, so you want to remove whatever caused that to occur in the source for the doc.
What is needed to be explained:
ExceptionGroup
ExceptionGroup extends both BaseExceptionGroup and Exception.
BaseException