From: Raymond Hettinger Date: Wed, 7 Aug 2002 20:20:52 +0000 (+0000) Subject: GvR pointed out that only enclosing function bodies are part of nested scopes. X-Git-Tag: v2.3c1~4625 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ae7ef57cba593d6c7eee8d1fd887c98a135770b3;p=python GvR pointed out that only enclosing function bodies are part of nested scopes. --- diff --git a/Doc/tut/tut.tex b/Doc/tut/tut.tex index b7a909043d..6f7d22ec41 100644 --- a/Doc/tut/tut.tex +++ b/Doc/tut/tut.tex @@ -3553,11 +3553,11 @@ the namespace. Although scopes are determined statically, they are used dynamically. At any time during execution, there are at least three nested scopes whose namespaces are directly accessible: the innermost scope, which is searched -first, contains the local names; the namespaces of any enclosing code -blocks (a module, function, or class definition) which are searched starting -with the nearest enclosing scope; the middle scope, searched next, contains -the current module's global names; and the outermost scope (searched last) -is the namespace containing built-in names. +first, contains the local names; the namespaces of any enclosing +functions, which are searched starting with the nearest enclosing scope; +the middle scope, searched next, contains the current module's global names; +and the outermost scope (searched 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.