bpo-36739: Update controlflow.rst (GH-12983) · python/cpython@cee95fe (original) (raw)
`@@ -279,9 +279,11 @@ variables of the function. More precisely, all variable assignments in a
`
279
279
`function store the value in the local symbol table; whereas variable references
`
280
280
`first look in the local symbol table, then in the local symbol tables of
`
281
281
`enclosing functions, then in the global symbol table, and finally in the table
`
282
``
`-
of built-in names. Thus, global variables cannot be directly assigned a value
`
283
``
`` -
within a function (unless named in a :keyword:global
statement), although they
``
284
``
`-
may be referenced.
`
``
282
`+
of built-in names. Thus, global variables and variables of enclosing functions
`
``
283
`+
cannot be directly assigned a value within a function (unless, for global
`
``
284
`` +
variables, named in a :keyword:global
statement, or, for variables of enclosing
``
``
285
`` +
functions, named in a :keyword:nonlocal
statement), although they may be
``
``
286
`+
referenced.
`
285
287
``
286
288
`The actual parameters (arguments) to a function call are introduced in the local
`
287
289
`symbol table of the called function when it is called; thus, arguments are
`