Multiline lamba implementation in python.

exhuma.twn exhuma at gmail.com
Tue Jun 12 05:29:31 EDT 2007


On Jun 12, 5:57 am, "Gabriel Genellina" <gagsl-... at yahoo.com.ar>
wrote:
> En Tue, 12 Jun 2007 00:02:37 -0300, Josh Gilbert
> <jgilbert.pyt... at gmail.com> escribió:
>
> > I don't expect multiline lambdas to be added to Python. I'm not so sure
> > that
> > that's a bad thing. Regardless, isn't it possible to write your own
> > implementation of multiline lambdas as functions? Wouldn't that be a
> > win-win
> > for everyone?
>
> If you want to "implement multiline lambdas as functions"... why don't you
> use a plain old function?
>
> --
> Gabriel Genellina

I agree. lambdas are useful for simple things like "lambda x: x^2" or
so. Once you need more than that, you should consider refactoring
things into a "plain old function" ;)

In general I suppose that is a good idea anyhow to ensure future
compatibility. lambdas are to be removed in Py3k IIRC.




More information about the Python-list mailing list