You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In <6> annotations :"Each iteration in thisloop creates a new instance of averager; each is a generator object operating as a coroutine." and <7>:"Whenever grouper is sent a value, it’s piped ..., the value it returns is bound to results[key]. The while loop then proceeds to create another averager instance to consume more values."
Would I replace while True with yield?
This seems easier to understand
The text was updated successfully, but these errors were encountered:
Issue originally reported by @dongzeXD at fluentpython/example-code-2e#15, related to an example in post Classic Coroutines:
In <6> annotations :"Each iteration in thisloop creates a new instance of averager; each is a generator object operating as a coroutine." and <7>:"Whenever grouper is sent a value, it’s piped ..., the value it returns is bound to results[key]. The while loop then proceeds to create another averager instance to consume more values."
Would I replace
while True
withyield
?This seems easier to understand
The text was updated successfully, but these errors were encountered: