On Tue, Mar 2, 2021 at 1:53 PM Irit Katriel via Python-Dev <
python-dev@python.org> wrote:

> [...]
> I can't imagine people building deep trees of exceptions in practice (at
> least not on purpose).  But some nesting may show up naturally, and we need
> to support it because otherwise it can get awkward if, for example,
> asyncio.gather() needs to wrap an exception group that came from
> a TemporaryDirectory.__exit__().
>

I assume that in serious asyncio apps it is not uncommon to see some
operation use gather() to wrap several tasks, and then to see that
operation itself be passed to an outer gather() call together with some
other tasks. If several things go wrong you could easily end up with a
nested EG. Same in Trio -- you could have multiple nested "nurseries".

If you're catching such exceptions it may not be so important to be aware
of the nesting, but if you're logging tracebacks (or if the exception is
never caught and the program exits with a traceback) it is pretty important
to be able to show everything that went wrong without unnecessary
duplication of stack traces.

-- 
--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/ZKFEK5GZWXCINXDZLONSQDUZPPPVX3OV/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to