SizedIter

class guppylang.std.iter.SizedIter[source]

A wrapper around an iterator type L promising that the iterator will yield exactly n values.

Annotating an iterator with an incorrect size is undefined behaviour.

classmethod __class_getitem__(item: Any) type[source]
__iter__() SizedIter[L, n][source]

Dummy implementation making sized iterators iterable themselves.

static __new__(iterator: L @ owned) SizedIter[L, n][source]

Casts an iterator into a SizedIter.

unwrap_iter() L[source]

Extracts the actual iterator.