diff Doc/tutorial/classes.rst @ 50076:c7abfab4dcdb 3.0

Merged revisions 67525-67527,67529,67548-67549,67551-67552,67555,67578,67586,67593-67594,67596,67605-67606,67609,67612,67616-67617,67632,67635,67638 via svnmerge from svn+ssh://svn.python.org/python/branches/py3k ........ r67525 | georg.brandl | 2008-12-04 19:18:16 +0100 (Thu, 04 Dec 2008) | 2 lines #4527: fix "unicode or string". ........ r67526 | georg.brandl | 2008-12-04 19:19:41 +0100 (Thu, 04 Dec 2008) | 2 lines #4526: fix typo. ........ r67527 | georg.brandl | 2008-12-04 19:21:46 +0100 (Thu, 04 Dec 2008) | 2 lines #4521: fix getcwdu() vs getcwdb(). ........ r67529 | georg.brandl | 2008-12-04 19:28:38 +0100 (Thu, 04 Dec 2008) | 2 lines #4513: remove traces of zip() docstring from when it was izip(). ........ r67548 | guido.van.rossum | 2008-12-05 06:49:12 +0100 (Fri, 05 Dec 2008) | 3 lines Tweak verbiage and markup for relative/absolute import. Backport candidate. (I guess *all* changes to this file should be backported to the 3.0 branch.) ........ r67549 | martin.v.loewis | 2008-12-05 08:20:46 +0100 (Fri, 05 Dec 2008) | 2 lines Send mails to python-checkins now. ........ r67551 | georg.brandl | 2008-12-05 08:32:56 +0100 (Fri, 05 Dec 2008) | 2 lines #4355: refer to urlencode in the correct module. ........ r67552 | georg.brandl | 2008-12-05 08:45:54 +0100 (Fri, 05 Dec 2008) | 2 lines #4401: Re-add os.extsep. ........ r67555 | georg.brandl | 2008-12-05 08:57:51 +0100 (Fri, 05 Dec 2008) | 2 lines #4427: fix arguments for "y" BuildValue type. ........ r67578 | georg.brandl | 2008-12-05 16:12:15 +0100 (Fri, 05 Dec 2008) | 2 lines #4504, #4505: Update noddy examples in "Extending & Embedding". ........ r67586 | georg.brandl | 2008-12-05 16:55:41 +0100 (Fri, 05 Dec 2008) | 2 lines Manually merged r67583: move __import__ doc to the bottom. ........ r67593 | georg.brandl | 2008-12-05 19:04:41 +0100 (Fri, 05 Dec 2008) | 2 lines #4550: fix 2.x syntax in webservers howto. ........ r67594 | georg.brandl | 2008-12-05 19:06:58 +0100 (Fri, 05 Dec 2008) | 2 lines #4549: Mention nonlocal statement in tutorial section about scoping. ........ r67596 | georg.brandl | 2008-12-05 19:31:51 +0100 (Fri, 05 Dec 2008) | 2 lines Use :samp: role. ........ r67605 | georg.brandl | 2008-12-06 09:12:11 +0100 (Sat, 06 Dec 2008) | 2 lines #4557: remove 'c' typecode from array docs and add a note in whatsnew. ........ r67606 | georg.brandl | 2008-12-06 09:14:46 +0100 (Sat, 06 Dec 2008) | 2 lines cmp() is not really gone. ........ r67609 | georg.brandl | 2008-12-06 15:28:56 +0100 (Sat, 06 Dec 2008) | 2 lines #4562: fix zip() examples. ........ r67612 | skip.montanaro | 2008-12-06 18:25:02 +0100 (Sat, 06 Dec 2008) | 2 lines issue 4483 - _dbm build failures on systems with gdbm_compat lib. ........ r67616 | benjamin.peterson | 2008-12-06 19:32:13 +0100 (Sat, 06 Dec 2008) | 1 line there are only four asdl builtin types in py3k ........ r67617 | benjamin.peterson | 2008-12-06 19:33:20 +0100 (Sat, 06 Dec 2008) | 1 line update version number ........ r67632 | georg.brandl | 2008-12-07 15:09:20 +0100 (Sun, 07 Dec 2008) | 2 lines #4576: fix ob_type access. ........ r67635 | benjamin.peterson | 2008-12-07 15:58:03 +0100 (Sun, 07 Dec 2008) | 1 line document how to deal with binary standard streams ........ r67638 | benjamin.peterson | 2008-12-07 16:07:02 +0100 (Sun, 07 Dec 2008) | 1 line remove extraneous 'text' ........
author Georg Brandl <georg@python.org>
date Sun, 07 Dec 2008 15:52:13 +0000
parents c87b84db244c
children 93cf3a6ead63
line wrap: on
line diff
--- a/Doc/tutorial/classes.rst	Sun Dec 07 15:42:29 2008 +0000
+++ b/Doc/tutorial/classes.rst	Sun Dec 07 15:52:13 2008 +0000
@@ -119,12 +119,11 @@
 last) is the namespace containing built-in names.
 
 If a name is declared global, then all references and assignments go directly to
-the middle scope containing the module's global names. Otherwise, all variables
-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
+the middle scope containing the module's global names.  To rebind variables
+found outside of the innermost scope, the :keyword:`nonlocal` statement can be
+used; if not declared nonlocal, those variable 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).
 
 Usually, the local scope references the local names of the (textually) current
 function.  Outside functions, the local scope references the same namespace as