19-coroutine/coroaverager3:grouper
dongzeXD opened this issue · 1 comments
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
Thanks for reporting this.
I have moved most content about classic coroutines from the second edition to the companion web site. The former chapter 19 is now at Classic Coroutines, including the example with the issue you have reported.
Accordingly, I have recreated the issue in the site repository: fluentpython/book-site#4.
My priority now is to finish the book, so I will not be able to analyze the issue you reported until I deliver the revised draft. Thanks.