News for hackers. Stuff that matters.
Re:Coroutines are now in Clang trunk, libc++ by js2 on Friday May 26, 2017 @11:19AM (#14424655)
This is fixed in Python 3 with the nonlocal keyword. In Python 2, the idiomatic work-around is to have x be list of one item:

    def f():
        x = [0]
        def add(amt):
            x[0] += amt
        add(10)
        return x[0]

There are no comments on this comment yet.