On 24/02/2021 14:04, Random832 wrote:
On Tue, Feb 23, 2021, at 17:01, Rob Cliffe via Python-ideas wrote:
As far as I know, there is no case of valid syntax using 'lambda' where replacing 'lambda' by 'def' results in valid syntax. Can anyone provide a counter-example? If not, I would support allowing 'def' as an alternative to 'lambda' (allowing 'def' to ultimately become the recommended usage). I have an objection to this: "def" is short for define, and a lambda does not produce a definition. Yes it does. It defines a function just as `def ` does:
def f(): pass
g = lambda : None
print(f)
print(g)
Output:
This isn't just about saving keystrokes, and even if it were, saving only three would not be worth it for a syntax that is just as confusing as the existing one. _______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-leave@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/DQA6G2... Code of Conduct: http://python.org/psf/codeofconduct/