def dec(gen):

    def new_gen(x):
        g = gen(x)
value = next(g)
for v in g:
    yield value
value = v
return new_gen

@dec
def gen1(x):

    def gen2(x):
        if x <= 10:
            yield x
for v in gen2(x + 1):
    yield v
for v in gen2(x):
    yield v
for i in gen1(1):
    pass
Как украсить генератор в питоне