mirror of
https://github.com/python/cpython.git
synced 2025-11-11 14:44:57 +00:00
update for nonlocal keyword
This commit is contained in:
parent
0e13c9451e
commit
927ccd257f
1 changed files with 6 additions and 4 deletions
|
|
@ -422,12 +422,14 @@ Glossary
|
||||||
modules, respectively.
|
modules, respectively.
|
||||||
|
|
||||||
nested scope
|
nested scope
|
||||||
|
|
||||||
The ability to refer to a variable in an enclosing definition. For
|
The ability to refer to a variable in an enclosing definition. For
|
||||||
instance, a function defined inside another function can refer to
|
instance, a function defined inside another function can refer to
|
||||||
variables in the outer function. Note that nested scopes work only for
|
variables in the outer function. Note that nested scopes by default work
|
||||||
reference and not for assignment which will always write to the innermost
|
only for reference and not for assignment. Local variables both read and
|
||||||
scope. In contrast, local variables both read and write in the innermost
|
write in the innermost scope. Likewise, global variables read and write
|
||||||
scope. Likewise, global variables read and write to the global namespace.
|
to the global namespace. The :keyword:`nonlocal` allows writing to outer
|
||||||
|
scopes.
|
||||||
|
|
||||||
new-style class
|
new-style class
|
||||||
Old name for the flavor of classes now used for all class objects. In
|
Old name for the flavor of classes now used for all class objects. In
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue