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

Skip to content

Commit 7fabaf8

Browse files
committed
clarify discussion of iteration in the section on the "for" statement
(SF bug #829073)
1 parent 303e30e commit 7fabaf8

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

Doc/ref/ref7.tex

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,10 @@ \section{The \keyword{for} statement\label{for}}
134134
\productioncont{["else" ":" \token{suite}]}
135135
\end{productionlist}
136136

137-
The expression list is evaluated once; it should yield a sequence. The
138-
suite is then executed once for each item in the sequence, in the
137+
The expression list is evaluated once; it should yield an iterable
138+
object. An iterator is created for the result of the
139+
{}\code{expression_list}. The suite is then executed once for each
140+
item provided by the iterator, in the
139141
order of ascending indices. Each item in turn is assigned to the
140142
target list using the standard rules for assignments, and then the
141143
suite is executed. When the items are exhausted (which is immediately

0 commit comments

Comments
 (0)