iterating in reverse
Michael Hudson
mwh at python.net
Fri Jan 17 06:19:49 EST 2003
Erik Max Francis <max at alcyone.com> writes:
> If you expect they'll always be pretty small, then range will be
> perform better (in terms of speed).
I believe Raymond Hettinger got sufficiently annoying with this being
pointed out <wink> that this will no longer be true in 2.3. From the
whatsnew document:
xrange() objects now have their own iterator, making for i in
xrange(n) slightly faster than for i in range(n). (Patch by Raymond
Hettinger.)
Cheers,
M.
--
Worryingly, DEFUN appears to be a function that removes all the
fun from something: after using it all your code is converted
to C++. -- Tim Bradshaw, comp.lang.lisp
More information about the Python-list
mailing list