[Python-Dev] Re: Words rather than sigils in Structural Pattern Matching

2020年11月21日 16:28:23 -0800

On 22/11/20 6:47 am, David Mertz wrote:
I'm convinced by Guido, Brandt, and others that the binding use will be far more common, so adding extra characters for the 90% case does not feel desirable
Minimising the number of characters is not the only consideration.
Readability counts too, and I think the proposed DWIM rules suffer
in the readability area.
There are about five different contexts in which a bare name can
appear as part of a match case:
* As a constructor name
* As a bare name in an argument position
* As part of a dotted expression
* On the left of an =
* On the right of an =
Only in some of those contexts is it treated as a name to be
assigned. That's a fairly complex bit of mental parsing to do
when reading a case.
--
Greg
_______________________________________________
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/LMALNSPBLL3MHFOJHBGGO24IDS6CI5R3/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to