On Wed, Feb 24, 2021 at 7:09 PM Emily Bowman <silverback...@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-change-the-world/>
_______________________________________________ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://mail.python.org/archives/list/python-dev@python.org/message/OYKCVAOYAJKOI24DRWMUSJUJKGQ74CQ5/ Code of Conduct: http://python.org/psf/codeofconduct/