[Python-checkins] python/dist/src/Doc/tut tut.tex,1.156.4.1.2.6,1.156.4.1.2.7

rhettinger@users.sourceforge.net rhettinger@users.sourceforge.net
Wed, 07 Aug 2002 09:06:39 -0700


Update of /cvsroot/python/python/dist/src/Doc/tut
In directory usw-pr-cvs1:/tmp/cvs-serv13633

Modified Files:
      Tag: release22-maint
	tut.tex 
Log Message:
Describe nested scopes in the tutorial.  Closes SF bug 500704.


Index: tut.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/tut/tut.tex,v
retrieving revision 1.156.4.1.2.6
retrieving revision 1.156.4.1.2.7
diff -C2 -d -r1.156.4.1.2.6 -r1.156.4.1.2.7
*** tut.tex	26 Jun 2002 21:43:42 -0000	1.156.4.1.2.6
--- tut.tex	7 Aug 2002 16:06:35 -0000	1.156.4.1.2.7
***************
*** 3509,3518 ****
  
  Although scopes are determined statically, they are used dynamically.
! At any time during execution, exactly three nested scopes are in use
! (exactly three namespaces are directly accessible): the
! innermost scope, which is searched first, contains the local names,
! 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.
  
  Usually, the local scope references the local names of the (textually)
--- 3509,3523 ----
  
  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.
! 
! 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.
  
  Usually, the local scope references the local names of the (textually)