On Thu, Feb 11, 2021 at 12:42:39PM +0100, J. Pic wrote:
> foo(x): len(x)
>
> Would be equivalent to:
>
> foo = lambda x: len(x)
>
> Would that work?
The question is not whether it would work, but whether it would be a
good idea. What benefit does it give?
Just write:
def foo(x): return len(x)
and no new syntax is required.
--
Steve
_______________________________________________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://mail.python.org/archives/list/[email protected]/message/IHLLXBN5U7GMLT7GB7RWDZJYVPSWDBMV/
Code of Conduct: http://python.org/psf/codeofconduct/