bagofstuff.itertools
Tools for iterating or working on iterable things.
starting_at
starting_at(
items: Iterable[T],
start_at: int = 0,
direction: Direction = "forward",
) -> Iterator[T]
Create an iterator of all items starting at a given point.
This function creates an iterator of all the items in the initial iterable, starting at the given point and wrapping around the end if necessary.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
Iterable[T]
|
The items to iterate over. |
required |
|
int
|
The item to start out at. |
0
|
|
Direction
|
The direction to iterate in. |
'forward'
|
Returns:
| Type | Description |
|---|---|
Iterator[T]
|
An iterable of all the items starting at the given point. |