[Python-checkins] r60158 - python/trunk/Doc/tutorial/controlflow.rst

georg.brandl python-checkins at python.org
Mon Jan 21 17:51:51 CET 2008


Author: georg.brandl
Date: Mon Jan 21 17:51:51 2008
New Revision: 60158
Modified:
 python/trunk/Doc/tutorial/controlflow.rst
Log:
#997912: acknowledge nested scopes in tutorial.
Modified: python/trunk/Doc/tutorial/controlflow.rst
==============================================================================
--- python/trunk/Doc/tutorial/controlflow.rst	(original)
+++ python/trunk/Doc/tutorial/controlflow.rst	Mon Jan 21 17:51:51 2008
@@ -204,10 +204,11 @@
 The *execution* of a function introduces a new symbol table used for the local
 variables of the function. More precisely, all variable assignments in a
 function store the value in the local symbol table; whereas variable references
-first look in the local symbol table, then in the global symbol table, and then
-in the table of built-in names. Thus, global variables cannot be directly
-assigned a value within a function (unless named in a :keyword:`global`
-statement), although they may be referenced.
+first look in the local symbol table, then in the local symbol tables of
+enclosing functions, then in the global symbol table, and finally in the table
+of built-in names. Thus, global variables cannot be directly assigned a value
+within a function (unless named in a :keyword:`global` statement), although they
+may be referenced.
 
 The actual parameters (arguments) to a function call are introduced in the local
 symbol table of the called function when it is called; thus, arguments are


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /