Is there a more syntactically concise way of writing the following?
gen = (i for i in xrange(10)) index = 5 for i, v in enumerate(gen): if i is index:
You could do this, using count as an example generator:
count
from itertools import islice, count next(islice(count(), n, n+1))