syside.LazyIterator

class LazyIterator

Bases: typing.Generic[T]

at(arg0: int, /) syside.T | None

Get value at index. This is computed lazily. Returns None for out of bounds index.

Notes:

  • Has complexity O(n) so should be used sparingly.

  • Only positive indices are allowed since size is unknown.

__getitem__(arg0: int, /) syside.T

Get value at index, This is computed lazily. Throws IndexError on out of bounds.

Notes:

  • Has complexity O(n) so should be used sparingly.

  • Only positive indices are allowed since size is unknown.

empty() bool

Check if this range is empty.

__bool__() bool

Returns True if this range is not empty.

count() int

Count the number of items in this range. This is computed lazily.

collect() list[syside.T]

Collect all items into a list.

for_each(arg0: Callable[[syside.T], None | bool | syside.VisitAction], /) None

Lazily visit each item in this range. Visitation is stopped on returning False or VisitAction.Stop;

classmethod __class_getitem__(item)