Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f6f3f53

Browse files
committed
Merged revisions 82376 via svnmerge from
svn+ssh://[email protected]/python/branches/py3k ........ r82376 | benjamin.peterson | 2010-06-29 13:36:39 -0500 (Tue, 29 Jun 2010) | 1 line update for nonlocal keyword ........
1 parent acf16de commit f6f3f53

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

Doc/glossary.rst

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -420,12 +420,14 @@ Glossary
420420
modules, respectively.
421421

422422
nested scope
423+
423424
The ability to refer to a variable in an enclosing definition. For
424425
instance, a function defined inside another function can refer to
425-
variables in the outer function. Note that nested scopes work only for
426-
reference and not for assignment which will always write to the innermost
427-
scope. In contrast, local variables both read and write in the innermost
428-
scope. Likewise, global variables read and write to the global namespace.
426+
variables in the outer function. Note that nested scopes by default work
427+
only for reference and not for assignment. Local variables both read and
428+
write in the innermost scope. Likewise, global variables read and write
429+
to the global namespace. The :keyword:`nonlocal` allows writing to outer
430+
scopes.
429431

430432
new-style class
431433
Old name for the flavor of classes now used for all class objects. In

0 commit comments

Comments
 (0)