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:

<function f at 0x016B87C0>
<function <lambda> at 0x02423190>

  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-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/DQA6G2AWX3TCAKCOTC3JPGX66S772JPK/
Code of Conduct: http://python.org/psf/codeofconduct/

_______________________________________________
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/IW4LMI2A5KMNI5TV6QHDRP6T4IKON3XJ/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to