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)