LazyIterator
- class LazyIterator[T]
-
Children
Members defined in
LazyIterator(7 members)
Returns
Trueif this range is not empty.
Get value at index, This is computed lazily. Throws
IndexErroron out of bounds.
Get value at index. This is computed lazily. Returns
Nonefor out of bounds index.
Collect all items into a
list.
Count the number of items in this range. This is computed lazily.
Check if this range is empty.
Lazily visit each item in this range. Visitation is stopped on returning
FalseorVisitAction.Stop; Methods
- __bool__() bool
Returns
Trueif this range is not empty.
- __getitem__(arg0: int, /) syside.T
Get value at index, This is computed lazily. Throws
IndexErroron 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
Nonefor 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
FalseorVisitAction.Stop;