Commit 7fabaf83 authored by Fred Drake's avatar Fred Drake

clarify discussion of iteration in the section on the "for" statement

(SF bug #829073)
parent 303e30ef
...@@ -134,8 +134,10 @@ sequence (such as a string, tuple or list) or other iterable object: ...@@ -134,8 +134,10 @@ sequence (such as a string, tuple or list) or other iterable object:
\productioncont{["else" ":" \token{suite}]} \productioncont{["else" ":" \token{suite}]}
\end{productionlist} \end{productionlist}
The expression list is evaluated once; it should yield a sequence. The The expression list is evaluated once; it should yield an iterable
suite is then executed once for each item in the sequence, in the object. An iterator is created for the result of the
{}\code{expression_list}. The suite is then executed once for each
item provided by the iterator, in the
order of ascending indices. Each item in turn is assigned to the order of ascending indices. Each item in turn is assigned to the
target list using the standard rules for assignments, and then the target list using the standard rules for assignments, and then the
suite is executed. When the items are exhausted (which is immediately suite is executed. When the items are exhausted (which is immediately
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment