summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2008-07-21 18:26:21 (GMT)
committerGeorg Brandl <georg@python.org>2008-07-21 18:26:21 (GMT)
commitbe44991baa5282279eb14a18294d78d7358ac3ec (patch)
tree511f357484d166b353be0ed569773c6b1bc2f0d2 /Doc
parentf3f67599fe2c1935c33eadceceea85286086e294 (diff)
downloadcpython-be44991baa5282279eb14a18294d78d7358ac3ec.zip
cpython-be44991baa5282279eb14a18294d78d7358ac3ec.tar.gz
cpython-be44991baa5282279eb14a18294d78d7358ac3ec.tar.bz2
nonlocal is not in 2.6.
Diffstat (limited to 'Doc')
-rw-r--r--Doc/tutorial/classes.rst6
1 files changed, 2 insertions, 4 deletions
diff --git a/Doc/tutorial/classes.rst b/Doc/tutorial/classes.rst
index dddbb0c..bca9108 100644
--- a/Doc/tutorial/classes.rst
+++ b/Doc/tutorial/classes.rst
@@ -123,8 +123,6 @@ found outside of the innermost scope are read-only (an attempt to write to such
a variable will simply create a *new* local variable in the innermost scope,
leaving the identically named outer variable unchanged).
-.. XXX mention nonlocal
-
Usually, the local scope references the local names of the (textually) current
function. Outside functions, the local scope references the same namespace as
the global scope: the module's namespace. Class definitions place yet another
@@ -138,8 +136,8 @@ language definition is evolving towards static name resolution, at "compile"
time, so don't rely on dynamic name resolution! (In fact, local variables are
already determined statically.)
-A special quirk of Python is that -- if no :keyword:`global` or
-:keyword:`nonlocal` statement is in effect -- assignments to names always go
+A special quirk of Python is that -- if no :keyword:`global`
+statement is in effect -- assignments to names always go
into the innermost scope. Assignments do not copy data --- they just bind names
to objects. The same is true for deletions: the statement ``del x`` removes the
binding of ``x`` from the namespace referenced by the local scope. In fact, all