I came across this code snippet for round robin in <https://more-itertools.readthedocs.io/en/latest/api.html>, but I couldn't understand how the last line `nexts = cycle(islice(nexts, pending))` removes the exhausted generator from nexts iterator. To my understanding, this removes the last one from input but shouldn't we remove the first one, i.e. the current one that throws this exception?

```
def roundrobin(*iterables):
    """Yields an item from each iterable, alternating between them.

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

    This function produces the same output as :func:`interleave_longest`, but
    may perform better for some inputs (in particular when the number of
    iterables is small).

    """
    # Recipe credited to George Sakkis
    pending = len(iterables)
    if PY2:
        nexts = cycle(iter(it).next for it in iterables)
    else:
        nexts = cycle(iter(it).__next__ for it in iterables)
    while pending:
        try:
            for next in nexts:
                yield next()
        except StopIteration:
            pending -= 1
            nexts = cycle(islice(nexts, pending))

```