Multiline lamba implementation in python.

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Wed Jun 13 02:40:13 EDT 2007


En Tue, 12 Jun 2007 20:48:41 -0300, Josh Gilbert  
<jgilbert.python at gmail.com> escribió:

> Guido doesn't want multiline lambdas, that's a really good reason not to  
> add
> them. They are, on the other hand, very useful at times. Even if he did  
> add
> multiline lambdas it's not certain that he would allow statements in  
> them,
> currently they're expression only. The beauty of my suggestion is that

But you already have "multiline" lambdas right now in that sense, no need  
to add anything. I think you were talking about lambdas *with* statements  
inside.

bin = lambda x:((x&8 and '*' or '_') +
                 (x&4 and '*' or '_') +
                 (x&2 and '*' or '_') +
                 (x&1 and '*' or '_'))

-- 
Gabriel Genellina




More information about the Python-list mailing list