Python作用域,local,global的scope
2017-04-12 本文已影响93人
c4a1d989518e
重点:

局部作用域与全局作用域:

还有就是关于Python中的闭包。

闭包的定义:如果在一个内部函数里,对在外部函数内(但不是在全局作用域)的变量进行引用,那么内部函数就被认为是闭包(closure)
文章参考:
重点:
局部作用域与全局作用域:
还有就是关于Python中的闭包。
闭包的定义:如果在一个内部函数里,对在外部函数内(但不是在全局作用域)的变量进行引用,那么内部函数就被认为是闭包(closure)
文章参考: