Skip to content

Commit

Permalink
PEP-654: state that interior nodes are checked for match in subgroup/…
Browse files Browse the repository at this point in the history
…split (GH-2113)
  • Loading branch information
iritkatriel authored Oct 19, 2021
1 parent 859b31c commit f991f60
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pep-0654.rst
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,13 @@ contains only those exceptions for which the condition is true:
>>>
The match condition is also applied to interior nodes (the exception
groups), and a match causes the whole subtree rooted at this node
to be included in the result.

Empty nested groups are omitted from the result, as in the
case of ``ExceptionGroup("three")`` in the example above. If none of the
leaf exceptions match the condition, ``subgroup`` returns ``None`` rather
exceptions match the condition, ``subgroup`` returns ``None`` rather
than an empty group. The original ``eg``
is unchanged by ``subgroup``, but the value returned is not necessarily a full
new copy. Leaf exceptions are not copied, nor are exception groups which are
Expand Down

0 comments on commit f991f60

Please sign in to comment.