On Thu, 05 Jun 2008 23:56:40 -0700, dwahli wrote:

> 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)

Useless use of a generator expression.  This:

gen = itertools.izip(itertools.count(8), [0, 1, 1, 1, 1, 1, 1, 2, 2, 3, 3])
print list(gen)

has the same effect without the intermediate generator that does nothing
but passing the items.

Ciao,
        Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to