]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Don't make promises about about the visibility of the induction variable.
authorRaymond Hettinger <python@rcn.com>
Tue, 21 Oct 2003 18:43:15 +0000 (18:43 +0000)
committerRaymond Hettinger <python@rcn.com>
Tue, 21 Oct 2003 18:43:15 +0000 (18:43 +0000)
Doc/tut/tut.tex

index 8cf9f34efc6608029b86b159fe7ac2011d13bf45..661ac206da8d39446ebb4e4b828b8174896f893a 100644 (file)
@@ -1938,18 +1938,6 @@ applied to functions with more than one argument and to nested functions:
 ['3.1', '3.14', '3.142', '3.1416', '3.14159']
 \end{verbatim}
 
-To make list comprehensions match the behavior of \keyword{for}
-loops, assignments to the loop variable remain visible outside
-of the comprehension:
-
-\begin{verbatim}
->>> x = 100                     # this gets overwritten
->>> [x**3 for x in range(5)]
-[0, 1, 8, 27, 64]
->>> x                           # the final value for range(5)
-4
-\end{verbatim}
-
 
 \section{The \keyword{del} statement \label{del}}