
On Wed, Feb 24, 2021 at 7:09 PM Emily Bowman <silverbacknet@gmail.com> wrote:
After reading through the PEP and skimming the code (but I didn't build it), something I didn't see: What happens to a currently conforming except check?
try: async with trio.open_nursery() as nursery: # Make two concurrent calls to child() nursery.start_soon(child) nursery.start_soon(child) except ValueError: pass
I've removed the * from the example: Say the interface was built for 3.7, but the "trio" module has been upgraded to use ExceptionGroups which can't fall back to a standalone exception.
Silently hand back the first exception, or the first matching exception? Deprecation warning? Silently skip? Context-specific error? Run the default error handler?
I think that deserves a statement in the PEP.
The ExceptionGroup would bubble up. IIRC this Trio behavior is considered problematic by the Trio developers, because it means that if *two* children fail with ValueError, it will raise MultiError and the except clause will not trigger (see the "MultiError v2" issue linked from the PEP). But changing trio.open_nursery() to raise ExceptionGroup would be considered backwards compatible. I would recommend introducing a new API instead. This is discussed (though maybe not in enough detail?) under Backwards Compatibility in the PEP. -- --Guido van Rossum (python.org/~guido) *Pronouns: he/him **(why is my pronoun here?)* <http://feministing.com/2015/02/03/how-using-they-as-a-singular-pronoun-can-c...>