On 18/07/20 4:34 am, Richard Levasseur wrote:
match get_point() into m:
   case Point(m.x, m.y):
     print(m.x, m.y)
   ...etc...

Personally, I thought this was a rather elegant solution to the load-vs-store problem for names. This is because, essentially, it changes the mental model from "some non-dotted names are special, some aren't, keep a careful eye out" to "only "m." is special, everything else is regular".

This is a variant of "mark the assignments, not the values", but
with the marking done in a somewhat subtle way that can potentially
change from one match statement to another. I have trouble seeing
this as an improvement over just picking a character to use for
the marking.

--
Greg
_______________________________________________
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/G2LOCBWEKHRH3PCUXDQFOBRJIZCVPTYW/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to