Mutable Functions
Mutable Functions
The Effect of Nonlocal Statements nonlocal <name> ,<name>,... Effect Futyre_assignments to that name change its pre-existing binding in the first non-local frame of the Icurrent environment jn which that name is bound. Python Docs:an enclosing scope" From the Python 3 language reference: Names listed in a nonlocal statement must refer to pre-existing bindings in an enclosing scope. Names listed ina statement must not collide with pre-xisting bindingsinth Current frame http://docs.python org/release/3.1.3/reference/simple_stmts.html#the-nonlocal-statement http://www.python.org/dev/peps/pep-3104/
The Effect of Nonlocal Statements http://www.python.org/dev/peps/pep-3104/ From the Python 3 language reference: Names listed in a nonlocal statement must refer to pre-existing bindings in an enclosing scope. Names listed in a nonlocal statement must not collide with pre-existing bindings in the local scope. http://docs.python.org/release/3.1.3/reference/simple_stmts.html#the-nonlocal-statement Effect: Future assignments to that name change its pre-existing binding in the first non-local frame of the current environment in which that name is bound. nonlocal <name> , <name>, ... Python Docs: an "enclosing scope" 12 Current frame