def iterator_mix(*iterators):
    """
    Iterating over list of iterators.
    Bit like zip, but zip stops after the
    shortest iterator is empty, abd here
    we go one until all iterators are empty.
    """
    while True:
        one_left = False

        for it in iterators:
            try:
                yield it.next()
            except StopIteration:
                pass
            else:
                one_left = True

        if not one_left:
            break
def iterator_mix ( * iterators ) : while True : one_left = False for it in iterators : try : yield it . next ( ) except StopIteration : pass else : one_left = True if not one_left : break
Iterating over list of iterators.
    Bit like zip, but zip stops after the
    shortest iterator is empty, abd here
    we go one until all iterators are empty.