New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
itertools roundrobin() #38672
Comments
a patch to add the roundrobin() and window() objects to test_itertools.py in a seperate patch |
Logged In: YES *Please post the tests to this patch and close the other patch. *Add a documentation patch to this patch *Let's drop the addition of window(). The C code for it is less
|
Logged In: YES added Lib/test/test_itertools.py patch here, deleted old |
Logged In: YES pushed to 2.4 |
Logged In: YES Great. I look forward to it. |
Logged In: YES Jack, are you still working on this one? |
Logged In: YES The newest triplet of module/test/documentation incorporate |
Logged In: YES Decided not to include this in Py2.4. The tool is not sufficiently general. It has only one use The point in favor of the tool is that it cannot be |
Logged In: YES For the record, here a simple and efficient roundrobin task def roundrobin(*iterables):
pending = deque(iter(i).next for i in iterables)
gettask, scheduletask = pending.popleft, pending.append
while pending:
task = gettask()
try:
yield task()
except StopIteration:
continue
scheduletask(task)
for value in roundrobin('abc', 'd', 'efgh'):
print value |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: