Skip to content

Fix naming and confusing example in gotchas #265

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

Merged
merged 2 commits into from
Apr 14, 2013

Conversation

simon-weber
Copy link
Contributor

Multipliers were named adders in the later examples; this was fixed.

To avoid confusion, I changed the def example on line 145 from a generator to using a list. If people were to run the example using the test code provided, it would actually output the "correct" (0 2 4...) answer, since the functions are run immediately after generation, and before the generation of the next function. However, consuming the entire generator and then running the functions shows the "misleading" (8 8 8) answer, since the value of i is updated at that point.

@kennethreitz
Copy link
Contributor

Thanks!

kennethreitz pushed a commit that referenced this pull request Apr 14, 2013
Fix naming and confusing example in gotchas
@kennethreitz kennethreitz merged commit 08b8eec into realpython:master Apr 14, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants