map vs. list-comprehension

Mandus mandus at gmail.com
Wed Jun 29 05:46:15 EDT 2005


Hi there,

inspired by a recent thread where the end of reduce/map/lambda in Python was
discussed, I looked over some of my maps, and tried to convert them to
list-comprehensions.

This one I am not sure how to conver:

Given three tuples of length n, b,i and d, I now do:

map(lambda bb,ii,dd: bb+ii*dd,b,i,d)

which gives a list of length n. 

Anyone have an idea what the equivalent list comprehension will be?

take care,
-- 
Mandus - the only mandus around.



More information about the Python-list mailing list