generators : random shootout

David Eppstein eppstein at ics.uci.edu
Fri Jan 11 18:50:23 EST 2002


In article <pan.2002.01.11.17.12.23.738306.2860 at uchicago.edu>,
 Ben Wolfson <wolfson at uchicago.edu> wrote:

> Changing this to
> for i in zip(gr, xrange(1, N)):
>     pass
> 
> speeds it up a bit.

What's the point of null-looping over the list made by zip?
And did you really want to iterate exactly N-1 times?
Why not just
    zip(gr,xrange(N))
?
-- 
David Eppstein       UC Irvine Dept. of Information & Computer Science
eppstein at ics.uci.edu http://www.ics.uci.edu/~eppstein/



More information about the Python-list mailing list