mcfonts.iter

Module Contents

split_iterator[S, T](source: collections.abc.Iterator[S], transform: collections.abc.Callable[[S], T], split_at: int) collections.abc.Generator[collections.abc.Sequence[T]]

Split an iterator into a generator of sequences of transformed elements.

Parameters:
source : collections.abc.Iterator[S]

Source iterator.

transform : collections.abc.Callable[[S], T]

Function that is called with each element of source.

split_at : int

integer of how many values to let in each sequence before yielding it and moving on.

Return type:

collections.abc.Generator[collections.abc.Sequence[T]]