[Python-ideas] Enhance definition of functions

Musical Notation musicdenotation at gmail.com
Tue Jul 30 17:19:07 CEST 2013


Yes, I know that multiline lambda will never be implemented in Python, but in many languages it is possible to write an anonymous function without using lambda at all.
In JavaScript:
Instead of "function <name>(<variables>){code}" you can write "var name; name=function(<variables>){code}"
Python (proposed):
def func(a,b):
    print(a+b)
    return a+b

becomes

func=function a,b:
    print(a+b)
    return a+b
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20130730/1aa8a41f/attachment.html>


More information about the Python-ideas mailing list