On Tue, Feb 23, 2021 at 7:37 PM Ethan Furman <ethan@stoneleaf.us> wrote:
On 2/22/21 4:24 PM, Irit Katriel via Python-Dev wrote:

 > We would like to request feedback on PEP 654 -- Exception Groups and
 > except*.
 >
 > https://www.python.org/dev/peps/pep-0654/
 >
 > It proposes language extensions that allow programs to raise and
 > handle multiple unrelated exceptions simultaneously, motivated by the
 > needs of asyncio and other concurrency libraries, but with other use
 > cases as well.

It sounds like the long-term goal is to move away from `except` and
replace it with `except *` -- is that correct?

I don't think so -- if we expected that to happen the extra '*' in the syntax would be a nuisance. The premise of the PEP is rather that raising and catching multiple exceptions at once is always going to be an esoteric hobby. The most common case by far would be in async frameworks, but we don't expect 'async def' to eventually become the standard function definition either (nor 'await f()' the standard call :-).

And even in an async framework, I don't expect that every async function would be "upgraded" to raise ExceptionGroup -- only specific APIs like gather() or create_connection(). (Even for those, backwards compatibility concerns will probably mean that we'll have to introduce *new* APIs that can raise ExceptionGroup.) The PEP lists a handful of other use cases, none of which seem to suggest to me that this is going to be a common thing.

--
--Guido van Rossum (python.org/~guido)