mirror of https://github.com/python/cpython
[Bug #827209] Add footnote from Alex M. about listcomps leaking their index variables
This commit is contained in:
parent
8484fbf0f6
commit
cbd81556bb
|
@ -184,7 +184,11 @@ case, the elements of the new list are those that would be produced
|
||||||
by considering each of the \keyword{for} or \keyword{if} clauses a block,
|
by considering each of the \keyword{for} or \keyword{if} clauses a block,
|
||||||
nesting from
|
nesting from
|
||||||
left to right, and evaluating the expression to produce a list element
|
left to right, and evaluating the expression to produce a list element
|
||||||
each time the innermost block is reached.
|
each time the innermost block is reached\footnote{In Python 2.3, a
|
||||||
|
list comprehension "leaks" the control variables of each
|
||||||
|
\samp{for} it contains into the containing scope. However, this
|
||||||
|
behavior is deprecated, and relying on it will not work once this
|
||||||
|
bug is fixed in a future release}.
|
||||||
\obindex{list}
|
\obindex{list}
|
||||||
\indexii{empty}{list}
|
\indexii{empty}{list}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue