roundrobin

class iteration_utilities.roundrobin(*iterables)

Round-Robin implementation ([R6]).

Parameters:

iterables : iterable

Iterables to combine using the round-robin. Any amount of iterables are supported.

Returns:

roundrobin : generator

Iterable filled with the values of the iterables.

References

[R6](1, 2) https://en.wikipedia.org/wiki/Round-robin_scheduling

Examples

>>> from iteration_utilities import roundrobin
>>> list(roundrobin('ABC', 'D', 'EF'))
['A', 'D', 'E', 'B', 'F', 'C']
__length_hint__()

Tries to estimate for the length of the instance (returns 0 if an estimation is not possible).

Note

Requires Python >= 3.4