File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -143,10 +143,10 @@ language definition is evolving towards static name resolution, at "compile"
143143time, so don't rely on dynamic name resolution! (In fact, local variables are
144144already determined statically.)
145145
146- A special quirk of Python is that -- if no :keyword: `global ` statement is in
147- effect -- assignments to names always go into the innermost scope. Assignments
148- do not copy data --- they just bind names to objects. The same is true for
149- deletions: the statement ``del x `` removes the binding of ``x `` from the
146+ A special quirk of Python is that -- if no :keyword: `global ` or :keyword: ` nonlocal `
147+ statement is in effect -- assignments to names always go into the innermost scope.
148+ Assignments do not copy data --- they just bind names to objects. The same is true
149+ for deletions: the statement ``del x `` removes the binding of ``x `` from the
150150namespace referenced by the local scope. In fact, all operations that introduce
151151new names use the local scope: in particular, :keyword: `import ` statements and
152152function definitions bind the module or function name in the local scope.
You can’t perform that action at this time.
0 commit comments