Re:Introducing Closure Tools
by micheles on Friday November 06, 2009 @09:48AM
(#926023)
Python 3 has read-write closures. Check out the nonlocal
declaration.
[ Parent
| on HN ]
The nonlocal statement causes the listed identifiers to refer to previously bound variables in the nearest enclosing scope. [1]
While certainly a big improvement, we still can't access variables in arbitrary scopes, just local, nearest non-local, and global. To me, this seems a significantly more complex way of specifying variable scope than just declaring it explicitly.
1. http://docs.python.org/dev/3.0/reference/simple_stmts.html#t...