aioplus.anth¶
- async aioplus.anth(aiterable, /, *, n, default=Ellipsis)¶
Return the
n-th item ofaiterable.- Parameters:
aiterable (AsyncIterable[T]) – Iterable.
n (int) – Index.
default (D, unset) – Default.
- Returns:
Item.
- Return type:
T | D
Notes
If
aiterable[n]does not exist anddefaultis unset, thenIndexErroris raised.
Examples
>>> aiterable = arange(23) >>> await anth(aiterable, n=4) 4