Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mistake in Chapter 18.1, under for loops #1994

Closed
Zoybean opened this issue Jun 17, 2019 · 1 comment
Closed

Mistake in Chapter 18.1, under for loops #1994

Zoybean opened this issue Jun 17, 2019 · 1 comment
Labels

Comments

@Zoybean
Copy link
Contributor

Zoybean commented Jun 17, 2019

In Chapter 18.1, the section on for Loops says:

We use the enumerate method to adapt an iterator to produce a value and that value’s index in the iterator, placed into a tuple. The first call to enumerate produces the tuple (0, 'a'). When this value is matched to the pattern (index, value), index will be 0 and value will 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.

Zoybean added a commit to Zoybean/book that referenced this issue Jun 18, 2019
Zoybean added a commit to Zoybean/book that referenced this issue Jun 18, 2019
@carols10cents
Copy link
Member

Fixed by #1998

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants