Undocumented behavior of predicates in ExceptionGroup
methods
#99563
Labels
interpreter-core
(Objects, Python, Grammar, and Parser dirs)
type-bug
An unexpected behavior, bug, or error
I want to understand if my finding is a bug, or it works as intended and just needs a better explanation in the docs.
Right now the docs say:
So, basically it promises that it will call this predicate for all exceptions in a group.
Let's test this:
Notice that the first time that it is called, it uses
ExceptionGroup
argument.But, let try to always return
True
this time:Now it is only called once.
As far as I understand it works like this:
ExceptionGroup
itselfTrue
is returned, it just uses this group as a result and endsFalse
is returned the first time, it then calls this function again for all the exceptions in a groupCode to illustrate that:
Is it correct, @iritkatriel?
I found it while working on python/typeshed#9219
The text was updated successfully, but these errors were encountered: