[Tutor] map vs. list comprehension

Michael Broe mbroe at columbus.rr.com
Tue Feb 14 21:39:27 CET 2006


I read somewhere that the function 'map' might one day be deprecated  
in favor of list comprehensions.

But I can't see a way to do this in a list comprehension:

 >>> map (pow, [2, 2, 2, 2], [1, 2, 3, 4])
[2, 4, 8, 16]

Is there a way?

Cheers,
Mike


More information about the Tutor mailing list