[Python-ideas] Multi Statement Lambdas
andrej.wins at gmail.com
Sun Oct 21 12:28:40 EDT 2018
A def function has to be named.
Wheres a lambda expression can be passed anonymously to any other function
as an argument.
*map(lambda x: x**2, array)*
Coming up with a name here is not needed, as the operation is expressive
Am So., 21. Okt. 2018 um 18:17 Uhr schrieb Anders Hovmöller <
boxed at killingar.net>:
> > A powerful general purpose language should not limit itself to one
> statement in a closure.
> Nitpick on language: It doesn't. Lambdas are not the only way to do a
> It's important to be precise when discussing these things.
> > Lets add mutli-statement lambdas to python either with just curly braces
> or with an indent based machine.
> Mostly it's just better with a function. Do you have some more compelling
> examples where you can't use a function smoothly?
> / Anders
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-ideas