Much of the discussion seems to focus on how to distinguish between a variable
as a provider of a value and a variable as receiver of a matched value.
In normal Python syntax a variable in an expression provides a value, please
let’s keep that unchanged.
So it seems to me we should explicitly mark a variable to receive a matched
value.
I have seen ‘?’ suggested as a prefix to do this, ‘\’ would also do fine.
This would solve the single variable issue, too:
case foo:
matches the value of ‘foo’, while
case \foo:
matches anything and stores it in ‘foo’.
This would also mean
case Point(x=\x, y=\y):
should be used to obtain x and y from the Point instance.
_______________________________________________
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/3MC2ZKDVRSDYRBZSYSFDR4M6GKQXITO2/
Code of Conduct: http://python.org/psf/codeofconduct/