Iterables can only be iterated over once, after which they are exhausted.
When looping over a given iterable a second time in a for loop, no more elements are returned.
Loop over itertools.product()
first instead, then over your list of tuples to generate ouput:
from itertools import product
def compose(lst_of_tuples, iter=True):
iters = get_iters() if iter else get_lists()
return [t + i for i in product(*get_iters()) for t in lst_of_tuples]
This produces:
>>> print compose([(1,2,3)], True)
[(1, 2, 3, 'a1', 'b1'), (1, 2, 3, 'a1', 'b2'), (1, 2, 3, 'a2', 'b1'), (1, 2, 3, 'a2', 'b2')]
>>> print compose([(1,2,3)], False)
[(1, 2, 3, 'a1', 'b1'), (1, 2, 3, 'a1', 'b2'), (1, 2, 3, 'a2', 'b1'), (1, 2, 3, 'a2', 'b2')]