map vs. list-comprehension

Terry Reedy tjreedy at udel.edu
Wed Jun 29 15:54:03 EDT 2005


"F. Petitjean" <littlejohn.75 at news.proxad.net> wrote in message 
news:42c27238$0$26269$626a14ce at news.free.fr...
>res = [ bb+ii*dd for bb,ii,dd in zip(b,i,d) ]

> Hoping that zip will not be deprecated.

Cease worrying.  Zip was added to replace the zipping behavior of map and 
the idiom map(None, a, b, ...).  It simultaneously altered the behavior for 
unequal length inputs to stop with the shortest instead of padding to the 
longest.

tjr 






More information about the Python-list mailing list