
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