Clarify bullets for Function scope (#403)
* Clarify bullets for Function scope * fix backticks
This commit is contained in:
parent
f026481062
commit
c04dd529ad
|
@ -102,8 +102,8 @@ Instead, ``locals()`` is expected to return a mutable *snapshot* of the
|
|||
function's local variables and any referenced nonlocal cells with the following
|
||||
semantics:
|
||||
|
||||
* each call to ``locals()`` returns the *same* mapping
|
||||
* each call to ``locals()`` updates the mapping with the current
|
||||
* each call to ``locals()`` returns the *same* mapping object
|
||||
* each call to ``locals()`` updates the mapping to the current
|
||||
state of the local variables and any referenced nonlocal cells
|
||||
* changes to the returned mapping are *never* written back to the
|
||||
local variable bindings or the nonlocal cell references
|
||||
|
@ -115,7 +115,7 @@ For interpreters that provide access to frame objects, the ``frame.f_locals``
|
|||
attribute at function scope is expected to be a write-through proxy that
|
||||
immediately updates the local variables and reference nonlocal cell bindings.
|
||||
Additional entries may also be added to ``frame.f_locals`` and will be
|
||||
accessible through both ````frame.f_locals`` and ``locals()`` from inside the
|
||||
accessible through both ``frame.f_locals`` and ``locals()`` from inside the
|
||||
frame, but will not be accessible by name from within the function (as any
|
||||
names which don't appear as local or nonlocal variables at compile time will
|
||||
only be looked up in the module globals and process builtins, not in the
|
||||
|
|
Loading…
Reference in New Issue