Hi, Le 23/11/2020 à 01:41, Greg Ewing a écrit : > On 23/11/20 7:49 am, Daniel Moisset wrote: >> Look at the following (non-pattern-matching) snippet: >> >> event = datetime.date(x, month=y, day=z) > > The only names that are treated as lvalues there are to the left > of an '='. […] This is a crucial point for me as well. Especially "month=y" meaning assign from month to y in "case datetime.date(x, month=y, day=z)" still feels really weird, even after reading it times and again in this many-month-old discussion. Sure, people who use pattern matching daily will get used to it, but what about those who only use it once in a while?
I say this as someone who fully appreciates the parallelism between a pattern and the corresponding constructor, and the elegance of this design choice. The rational me likes it, but the instinctive me can't get comfortable with its consequences ;-) If it can be done, replacing the "=" sign with "as" feels like a good compromise: the parallelism is still there, with just enough difference to stand out. Cheers, Baptiste _______________________________________________ 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/P2OIXVBAPR7RDBJJA4DZICO3ZAJYP53E/ Code of Conduct: http://python.org/psf/codeofconduct/