diff options
author | Georg Brandl <georg@python.org> | 2008-01-21 16:51:51 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2008-01-21 16:51:51 (GMT) |
commit | aa0de3f130f74c8551cdf9b798447fafd305fe3a (patch) | |
tree | 8f802ac797dd072137e4564f0646956539ce66d1 /Doc/tutorial | |
parent | f8dd5b393c9a1e1320457f663cec2c39df90133d (diff) | |
download | cpython-aa0de3f130f74c8551cdf9b798447fafd305fe3a.zip cpython-aa0de3f130f74c8551cdf9b798447fafd305fe3a.tar.gz cpython-aa0de3f130f74c8551cdf9b798447fafd305fe3a.tar.bz2 |
#997912: acknowledge nested scopes in tutorial.
Diffstat (limited to 'Doc/tutorial')
-rw-r--r-- | Doc/tutorial/controlflow.rst | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Doc/tutorial/controlflow.rst b/Doc/tutorial/controlflow.rst index e42e23a..420c8d9 100644 --- a/Doc/tutorial/controlflow.rst +++ b/Doc/tutorial/controlflow.rst @@ -204,10 +204,11 @@ it. 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 |