I have two iterators, a list and an itertools.count object (i.e. an infinite value generator). I would like to merge these two into a resulting ite
list
itertools.count
A generator will solve your problem nicely.
def imerge(a, b): for i, j in itertools.izip(a,b): yield i yield j