In Python 3 we can change enclosing scope variables by declaring them in
nonlocal statements, so nested
defs can have access to names in enclosing functions.
nonlocaldeclares that a name will be changed in an enclosing scope.
nonlocalapplies to a name in an enclosing function’s scope.
nonlocalnames must already exist in the enclosing function’s scope when declared. They can exist only in enclosing functions and cannot be created by a first assignment in a nested