On Jun 6, 8:44 am, "Terry Reedy" <[EMAIL PROTECTED]> wrote: > > Of course, enumerate(iterable) is just a facade over zip(itertools.count(), > iterable)
So you could write: gen = (x for x in itertools.izip(itertools.count(8), [0, 1, 1, 1, 1, 1, 1, 2, 2, 3, 3])) print list(gen) Using zip like you own example is the best option. If you have a huge amount of data and only want to iterate over the result, using a generator is probably better: gen = (x for x in itertools.izip(itertools.count(8), [0, 1, 1, 1, 1, 1, 1, 2, 2, 3, 3])) for i, j in gen: ... your code here ... -- http://mail.python.org/mailman/listinfo/python-list