python2.7
list = []
def fn1(x=1):
def fn2():
print x
y=fn2
list.insert(0,y)
fn1()
ref_to_fn2 = list[0]
ref_to_fn2()
def fn2():
print x
x=2
python2.7
list = []
def fn1(x=1):
def fn2():
print x
y=fn2
list.insert(0,y)
fn1()
ref_to_fn2 = list[0]
ref_to_fn2()
def fn2():
print x
x=2