]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
clarify discussion of iteration in the section on the "for" statement
authorFred Drake <fdrake@acm.org>
Tue, 2 Nov 2004 19:18:20 +0000 (19:18 +0000)
committerFred Drake <fdrake@acm.org>
Tue, 2 Nov 2004 19:18:20 +0000 (19:18 +0000)
(SF bug #829073)

Doc/ref/ref7.tex

index 44a58c86dfddb6375717a16bd47303208e0a6b24..726477214416a4b2b4ad6db20046984c68deaed1 100644 (file)
@@ -134,8 +134,10 @@ sequence (such as a string, tuple or list) or other iterable object:
   \productioncont{["else" ":" \token{suite}]}
 \end{productionlist}
 
-The expression list is evaluated once; it should yield a sequence.  The
-suite is then executed once for each item in the sequence, in the
+The expression list is evaluated once; it should yield an iterable
+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
 target list using the standard rules for assignments, and then the
 suite is executed.  When the items are exhausted (which is immediately