diff options
author | Fred Drake <fdrake@acm.org> | 2004-11-02 19:18:20 (GMT) |
---|---|---|
committer | Fred Drake <fdrake@acm.org> | 2004-11-02 19:18:20 (GMT) |
commit | 7fabaf8375b01b2e4fd514fa0549798b7070b027 (patch) | |
tree | 49e5977c605469b9ef6ce9156782f4b232a9e262 /Doc/ref/ref7.tex | |
parent | 303e30ef9f0f4335c3b09928d0a3037d1bfc247e (diff) | |
download | cpython-7fabaf8375b01b2e4fd514fa0549798b7070b027.zip cpython-7fabaf8375b01b2e4fd514fa0549798b7070b027.tar.gz cpython-7fabaf8375b01b2e4fd514fa0549798b7070b027.tar.bz2 |
clarify discussion of iteration in the section on the "for" statement
(SF bug #829073)
Diffstat (limited to 'Doc/ref/ref7.tex')
-rw-r--r-- | Doc/ref/ref7.tex | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Doc/ref/ref7.tex b/Doc/ref/ref7.tex index 92ee655..5e50a74 100644 --- a/Doc/ref/ref7.tex +++ b/Doc/ref/ref7.tex @@ -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 |