for loop: range() result has too many items

Tim Roberts timr at probo.com
Fri Oct 16 07:42:21 CEST 2009


Matt Nordhoff <mnordhoff at mattnordhoff.com> wrote:
>
>That's what itertools.count() is for.
>
><http://docs.python.org/library/itertools.html#itertools.count>
>
>It'll be faster, too, since it's written in C. Not that it really
>matters, but it's always nice.

For being such a simple concept, I've been surprised how many places
itertools.count() has come in handy for me.
-- 
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.



More information about the Python-list mailing list