Skip to content

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