Raymond Hettinger <raymond.hettin...@gmail.com> added the comment:

Thanks for the suggestion.  I appreciate it even though I've decided to keep 
the current recipe.

While he proposed recipe is really good at eliminating exhausted input sources, 
it is slower at its core task of yielding outputs (which is typically the 
important part).

The O(n) step in the current code runs at C speed and is really fast.  On my 
six year old machine, running :cycle(islice(nexts, num_active))" for 1,000 
nexts takes only 186ns.

One other thought:  The existing recipe is also useful for showing off ways to 
use the itertools (which was really the principal purpose of having a recipes 
section).

----------
resolution: remind -> rejected
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue20727>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to