PEP-654: state that interior nodes are checked for match in subgroup/split (GH-2113)

This commit is contained in:
Irit Katriel 2021-10-19 23:16:50 +01:00 committed by GitHub
parent 859b31cd4a
commit f991f604b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -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