[Python-ideas] Lambda again: Anonymous function definition
taleinat at gmail.com
Thu Apr 3 15:20:46 CEST 2008
> Matt Chisholm wrote:
> Unfortunately, there's no way in Python to have a statement inside of an
> expression (because statements are delimited by line ends and
> indentation). Many people have attempted this, none have succeeded.
> Don't go there, you'll just be opening up old wounds...
>From my experience anonymous functions are very useful when writing
event-based code, such as client-side event handlers for web browsers
handlers in any language. I think having a simple, readable way to
define anonymous functions in Python would allow writing more concise
and readable Python code for such applications, thus making Python an
even better Jack-of-all-trades.
However, even if it were easy to implement with clear, simple syntax,
I'm not sure this would be a good idea; I'd leave this to more
experienced language developers.
More information about the Python-ideas