美文网首页
python: global v.s. nonlocal

python: global v.s. nonlocal

作者: 庞贝船长 | 来源:发表于2017-12-06 16:05 被阅读0次
    • Nonlocal
      Nonlocal is similar in meaning to global. 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.

    相关栗子阅读:

    read more

    PEP 3104 -- Access to Names in Outer Scopes

    相关文章

      网友评论

          本文标题:python: global v.s. nonlocal

          本文链接:https://www.haomeiwen.com/subject/ckhlixtx.html