[Python-Dev] Re: PEP 622 version 2 (Structural Pattern Matching)

2020年7月10日 03:14:11 -0700

If we are still not certain about the exact language to describe match then I 
would ask if the 'case' token is really required. It seems that I would prefer
match expr:
 pattern0:
 block0
 pattern1:
 block1
 .....
else:
 blockdefault
where the else: clause is optional.
Also for me the unusual case is the assignment to names in the pattern and I 
would prefer that that be marked in some way; I didn't like .name, but ?name 
seems OK (or perhaps => name). Also the restriction that assigned vars should 
only occur once in a pattern seems wrong. I would regard it as an additional 
constraint on the match, but I do admit I don't fully understand what's allowed 
in patterns.
Please disregard if the above is totally stupid.
_______________________________________________
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/5SJY2HAT2CHG2BKYV4IZDZVM2BZILXTT/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to