Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f12f324

Browse files
committed
Don't make promises about about the visibility of the induction variable.
1 parent e4b9d8c commit f12f324

1 file changed

Lines changed: 0 additions & 12 deletions

File tree

Doc/tut/tut.tex

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1949,18 +1949,6 @@ \subsection{List Comprehensions}
19491949
['3.1', '3.14', '3.142', '3.1416', '3.14159']
19501950
\end{verbatim}
19511951

1952-
To make list comprehensions match the behavior of \keyword{for}
1953-
loops, assignments to the loop variable remain visible outside
1954-
of the comprehension:
1955-
1956-
\begin{verbatim}
1957-
>>> x = 100 # this gets overwritten
1958-
>>> [x**3 for x in range(5)]
1959-
[0, 1, 8, 27, 64]
1960-
>>> x # the final value for range(5)
1961-
4
1962-
\end{verbatim}
1963-
19641952

19651953
\section{The \keyword{del} statement \label{del}}
19661954

0 commit comments

Comments
 (0)