a = 1; def foo(): b = a; return b foo() is a >> True
a = [] def foo(): b = a; return b foo().append(1) a >> [3]
c = () def bar(): d = c; return d bar() + (1,) c >> ()
I was simply illustrating how using a mutable data structure defined in an outer scope can bite you.