On 03/07/2020 00:12, Nick Coghlan wrote:
On Fri., 3 Jul. 2020, 2:27 am MRAB, <[email protected]> wrote:IMHO, the assignment statement should remain as it is, not sometimes assign and sometimes not. There could be another form that does matching: try ?x, 0 = (4,5)Huh, this made me wonder if "match/try" may fit people's brains better than "match/case". I know for me that I want to read case clauses the same way I would read them in C, which is thoroughly unhelpful. The following looks weird though, so I don't think I actually like it in practice: === match shape: try Point(x, y): ... try Rectangle(x0, y0, x1, y1, painted=True): ...
I'm actually surprised at how much I like that. It certainly gets me out of the C mindset and makes it easier for me to recognise that Point(x,y) isn't an instantiation.
-- Rhodri James *-* Kynesim Ltd _______________________________________________ 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/R32T63WXY3ILFKSMISY3KIKA7LUGBKZC/ Code of Conduct: http://python.org/psf/codeofconduct/
