File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -1011,7 +1011,9 @@ The :keyword:`nonlocal` statement causes the listed identifiers to refer to
10111011previously bound variables in the nearest enclosing scope excluding globals.
10121012This is important because the default behavior for binding is to search the
10131013local namespace first. The statement allows encapsulated code to rebind
1014- variables outside of the local scope besides the global (module) scope.
1014+ variables outside of the local scope besides the global scope. A :exc: `SyntaxError `
1015+ will be raised if the nearest enclosing scope is the global (module) scope.
1016+
10151017
10161018Names listed in a :keyword: `nonlocal ` statement, unlike those listed in a
10171019:keyword: `global ` statement, must refer to pre-existing bindings in an
You can’t perform that action at this time.
0 commit comments