On 2021-09-29 10:11, MRAB wrote:
I'd prefer something like "x -> x" "x => x" as an equivalent to "lambda
x: x":
I continue to find all such syntaxes less readable even than lambda.
The idea of using a hyphen and a greater-than sign to "draw" an arrow
doesn't sit well with me.
The only problem with lambda is that the word "lambda" (unlike other
Python keywords) is unusual and its relation to its function obscure.
If we're going to change something, we should just come up with a new
keyword like "shortdef" or (perhaps with these new parser possibilities
I've heard vague references to) just allow "def" to be used for lambdas
somehow. To my eye, adding arrow-like syntax doesn't help anything.
--
Brendan Barnwell
"Do not follow where the path may lead. Go, instead, where there is no
path, and leave a trail."
--author unknown
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://mail.python.org/archives/list/python-ideas@python.org/message/P5W6IESA3EJLJOSE7H6Z3YAMJHJ2KBKO/
Code of Conduct: http://python.org/psf/codeofconduct/