def saved_generator(gen):
    'Given a generator returns two generators, where 2nd one just replays\n\n    So the first one would be going through the generated items and 2nd one\n    would be yielding saved items\n    '
    saved = []

    def gen1():
        for x in gen:
            saved.append(x)
            (yield x)

    def gen2():
        for x in saved:
            (yield x)
    return (gen1(), gen2())
Given a generator returns two generators, where 2nd one just replays

So the first one would be going through the generated items and 2nd one
would be yielding saved items
def saved_generator(gen):
    'Given a generator returns two generators, where 2nd one just replays\n\n    So the first one would be going through the generated items and 2nd one\n    would be yielding saved items\n    '
    saved = []

    def gen1():
        for x in gen:
            saved.append(x)
            (yield x)

    def gen2():
        for x in saved:
            (yield x)
    return (gen1(), gen2())