fork download
def orig():
    yield 1
    print("you don't see it if orig() is called via wrapper()")
    yield 2

def wrapper():
    for i in orig():
        yield i
        break

print(list(wrapper())) # -> [1]
print("the point is wrapper yields one item at a time")
print(list(orig())) # -> [1, 2]
Success #stdin #stdout 0.02s 5852KB
stdin
Standard input is empty
stdout
[1]
the point is wrapper yields one item at a time
you don't see it if orig() is called via wrapper()
[1, 2]