[Python-Dev] Re: PEP 654 except* formatting

2021年10月03日 11:26:22 -0700

We can drop except. Say:
try:
 ..
handle T1:
 ...
handle T2:
 ...
Or ‘catch’, or something else.
> On 3 Oct 2021, at 19:12, MRAB <[email protected]> wrote:
> 
> On 2021年10月03日 18:50, Brandt Bucher wrote:
>> Łukasz Langa wrote:
>>> My idea is this:
>>> try:
>>> ...
>>> except group E as e:
>>> ...
>>> except group E1, T2 as e:
>>> ...
>>> Should be doable given the magical match-case contextual keywords 
>>> precedent. This looks nice and is explicit, since you will always get an 
>>> ExceptionGroup instance under `e`.
>> Heh, we crossed posts with the soft keywords. I like your idea ("except 
>> group") better than mine ("except each").
>> If we want to use an existing keyword instead of a soft keyword, how 
> about "except in E as e:".
> 
> The disadvantage, as I see it, from a linguistic point of view, is that 
> "except in" could be read as "excluding", but, then, so could "except each" 
> ("excluding each of these") and "except group" ("excluding this group").
> _______________________________________________
> Python-Dev mailing list -- [email protected]
> To unsubscribe send an email to [email protected]
> https://mail.python.org/mailman3/lists/python-dev.python.org/
> Message archived at 
> https://mail.python.org/archives/list/[email protected]/message/FUTYE36MLFAWU72KTHDEQY5JFDA2PQ4G/
> Code of Conduct: http://python.org/psf/codeofconduct/
_______________________________________________
Python-Dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/[email protected]/message/K3I7552LB6O5XS3KWLC2C2U5XME43HQ5/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to