Paul Rubin <http://[EMAIL PROTECTED]> wrote:

> Dan Bishop <[EMAIL PROTECTED]> writes:
> > If you ever do, it's trivial to write your own enumerate():
> > def enumerate(seq):
> >     index = 0
> >     for item in seq:
> >         yield (index, item)
> >         index += 1
> 
> That's a heck of a lot slower than the builtin, and if you're running it
> often enough for sys.maxint to be an issue, you may care about the speed.

Perhaps itertools.izip(itertools.count(), seq) might be faster (haven't
timed it, but itertools tends to be quite fast).


Alex
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to