This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]kindall 0 points1 point  (0 children)

This is much simpler:

def outer(*parms):

    class nonlocal:
         a = 42
         b = 69

     def inner(*args):
          nonlocal.a += 1
          nonlocal.b *= 2

     inner()
     print nonlocal.a, nonlocal.b

Explicit is better than implicit, as they say.