On 11/2/20 1:52 PM, Glenn Linderman wrote:
On 11/2/2020 1:42 PM, Guido van Rossum wrote:But we feel that `case x, x` can easily be misunderstood as "a tuple of two equal values"So what _is_ the syntax for "a tuple of two equal values" ? case x, ?x: # comes to mind (not that it is in the PEP :))
Using a guard statement: case x, y if x == y I believe supporting case x, x # look ma! no guard! is a possible future enhancement. -- ~Ethan~ _______________________________________________ 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/HA2YAGKS6FY63E3MLDDCAC7FNWA77T7Q/ Code of Conduct: http://python.org/psf/codeofconduct/