-
Notifications
You must be signed in to change notification settings - Fork 16
Open
Description
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
with yield
?
This seems easier to understand
Metadata
Metadata
Assignees
Labels
No labels