LazyIterator

class LazyIterator[T]
Children
Members defined in LazyIterator (7 members)

__bool__

__getitem__

at

collect

count

empty

for_each

Methods

__bool__() bool

Returns True if this range is not empty.

__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.

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.

collect() list[syside.T]

Collect all items into a list.

count() int

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

empty() bool

Check if this range is empty.

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;

Used in