python新增nonlocal关键字

def fa(a):
b = 2

def fb():
nonlocal b
print(b)

return fb


c = 2
fa(22)()
# python作用域:LEGB
原文地址:https://www.cnblogs.com/zhaoxianglong1987/p/7562182.html