PEP 572: Remove SLNBs from locals() to eliminate confusion
This commit is contained in:
parent
0b1c874bd5
commit
c36c28ff72
10
pep-0572.rst
10
pep-0572.rst
|
@ -49,6 +49,9 @@ Assignment to statement-local names is ONLY through this syntax. Regular
|
||||||
assignment to the same name will remove the statement-local name and
|
assignment to the same name will remove the statement-local name and
|
||||||
affect the name in the surrounding scope (function, class, or module).
|
affect the name in the surrounding scope (function, class, or module).
|
||||||
|
|
||||||
|
Statement-local names never appear in locals() or globals().
|
||||||
|
|
||||||
|
|
||||||
Execution order and its consequences
|
Execution order and its consequences
|
||||||
------------------------------------
|
------------------------------------
|
||||||
|
|
||||||
|
@ -264,12 +267,7 @@ Discrepancies in the current implementation
|
||||||
comprehensions), but not at top level. Making this work at top-level
|
comprehensions), but not at top level. Making this work at top-level
|
||||||
and in class definitions would be very much of value.
|
and in class definitions would be very much of value.
|
||||||
|
|
||||||
2. The interaction with locals() is currently slightly buggy. Ideally,
|
2. Assigning 'through' a SLNB is not implemented yet.
|
||||||
statement-local names will appear in locals() while they are active (and
|
|
||||||
shadow any other names from the same function); as an alternative, they
|
|
||||||
could simply never appear, even when in scope.
|
|
||||||
|
|
||||||
3. Assigning 'through' a SLNB is not implemented yet.
|
|
||||||
|
|
||||||
|
|
||||||
References
|
References
|
||||||
|
|
Loading…
Reference in New Issue