File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -422,12 +422,14 @@ Glossary
422422 modules, respectively.
423423
424424 nested scope
425+
425426 The ability to refer to a variable in an enclosing definition. For
426427 instance, a function defined inside another function can refer to
427- variables in the outer function. Note that nested scopes work only for
428- reference and not for assignment which will always write to the innermost
429- scope. In contrast, local variables both read and write in the innermost
430- scope. Likewise, global variables read and write to the global namespace.
428+ variables in the outer function. Note that nested scopes by default work
429+ only for reference and not for assignment. Local variables both read and
430+ write in the innermost scope. Likewise, global variables read and write
431+ to the global namespace. The :keyword: `nonlocal ` allows writing to outer
432+ scopes.
431433
432434 new-style class
433435 Old name for the flavor of classes now used for all class objects. In
You can’t perform that action at this time.
0 commit comments