aioplus.ahead¶
- aioplus.ahead(aiterable, /, *, n)¶
Return the first
nitems of theaiterable.- Parameters:
aiterable (AsyncIterable[T]) – An asynchronous iterable to retrieve items from.
n (SupportsIndex) – The number of items to retrieve from the start.
- Returns:
An asynchronous iterable yielding the first
nitems of theaiterable.- Return type:
AsyncIterable[T]
Examples
>>> aiterable = arange(23) >>> [num async for num in ahead(aiterable, n=4)] [0, 1, 2, 3]
See also