list-comprehension and map question (simple)

Reinhold Birkenfeld reinhold-birkenfeld-nospam at wolke7.net
Sun Mar 27 19:15:45 CEST 2005


Charles Hartman wrote:
> On Mar 27, 2005, at 11:50 AM, Nicolas Évrard wrote:
> 
>>>
>>> I hope the question is clear enough. I have a feeling I'm ignoring a  
>>> simple technique . . .
>>
>> lambda !
>>
>> map(lambda x: timestwo(getlength(x)), ...)
> 
> Ah, lambda! I've heard so much bad-mouthing of lambda that I forgot to 
> learn it . . . This is quite cool, and it looks as though it would work 
> with more complicated function calls than the ones in my toy example. 
> Thanks.

Always keep in mind that a local named function can always be used
instead of lambda.

Reinhold



More information about the Python-list mailing list