RES: lambda question

Alves, Carlos Alberto - Coelce calves at coelce.com.br
Mon Mar 11 12:42:51 EST 2002


Thanks,
It solved my problem.

> -----Mensagem original-----
> De: Corrado Gioannini [mailto:corrado.gioannini at nekhem.com]
> Enviada em: segunda-feira, 11 de março de 2002 14:30
> Para: Alves, Carlos Alberto - Coelce
> Cc: python-list at python.org
> Assunto: Re: lambda question
> 
> 
> On Mon, Mar 11, 2002 at 02:06:51PM -0300, Alves, Carlos 
> Alberto - Coelce wrote:
> > second code:
> > 
> > 	def exe1(f,list):
> > 		return map(lambda x:eval(f),list)
> > 
> > Can someone explain to me why the first code works while 
> second doesn't.
> try this:
> 
> def exe1(f, list):
>     return map(lambda x, y=f: eval(y), list)
> 
> cheers,
> Corrado
> -- 
> Corrado Gioannini
> <corrado.gioannini at nekhem.com>
> 
> Nekhem Technologies
> Tel.: (+39) 011 4407581
> 
> -
> "Thought is only a flash between two long nights,
>                                          but this flash is 
> everything."
>                                                           (H. 
> Poincaré)
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20020311/8a29f4a2/attachment.html>


More information about the Python-list mailing list