This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author rhettinger
Recipients
Date 2007-07-22.16:51:50
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
FWIW, here is the optimized recipe:

def roundrobin(*iterables):
    pending = deque(iter(i).next for i in reversed(iterables))
    rotate, pop, _StopIteration = pending.rotate, pending.pop, StopIteration
    while pending:
        try:
            while 1:
                yield pending[-1]()
                rotate()
        except _StopIteration:
            pop()
History
Date User Action Args
2007-08-23 16:12:56adminlinkissue1757395 messages
2007-08-23 16:12:56admincreate