'closure' is a much-abused word. This is a closure over foo's x variable: def foo(): x = 3 def bar(): x += 1 return x return bar f = foo() print f() # print 4 g = foo() print f() # print 5 print g() # print 4 ...or it would be, if it worked. -- Hallvard