All pastes #390477 Raw Edit

Anonymous

public text v1 · immutable
·published 2007-03-11 14:10 UTC
rendered paste body
def make_adder(n):
    def fun ():
        while True:
            n +=1
            yield n
    return fun().next

x = make_adder(7)
y = x()
print y
stdout -- 8
y = x()
stdout -- 9
...