-
Nonlocal
Nonlocal is similar in meaning toglobal
. But it takes effect primarily in nested methods. It means "not a global or local variable." So it changes the identifier to refer to an enclosing method's variable.
相关栗子阅读:
- global, nonlocal
- stackoverflow 上的问题: Python nonlocal statement