-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Closed
Labels
Description
In Chapter 18.1, the section on for Loops says:
We use the
enumeratemethod to adapt an iterator to produce a value and that value’s index in the iterator, placed into a tuple. The first call toenumerateproduces the tuple(0, 'a'). When this value is matched to the pattern(index, value),indexwill be0andvaluewill be'a', printing the first line of the output.
It appears it should not say "The first call to enumerate", but rather "The first call to next", referring to the for loop implicitly calling next on the iterator, as there is only the one call to enumerate, and it produces not a tuple but a new iterator.