for loop: range() result has too many items

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

Matt Nordhoff <mnordhoff at> wrote:
>That's what itertools.count() is for.
>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
Providenza & Boekelheide, Inc.

More information about the Python-list mailing list