map vs. list-comprehension

Scott David Daniels Scott.Daniels at Acm.Org
Wed Jun 29 11:33:58 EDT 2005


Mandus wrote:
> 29 Jun 2005 10:04:40 GMT skrev F. Petitjean:
> 
>>Le Wed, 29 Jun 2005 09:46:15 +0000 (UTC), Mandus a écrit :
>>
>>res = [ bb+ii*dd for bb,ii,dd in zip(b,i,d) ]
> 
> seem to be a tad slower than the map, but nothing serious. Guess it's
> the extra zip.
You could try timing it using itertools.izip rather than zip.

--Scott David Daniels
Scott.Daniels at Acm.Org



More information about the Python-list mailing list