On Tue, Feb 23, 2021 at 7:37 PM Ethan Furman <et...@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)
*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/DVMATQ46G2IGRQWORUZUFD5NCSBKUWRH/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to