aioplus.atail¶
- aioplus.atail(aiterable, /, *, n)¶
Return the last
nitems of theaiterable.- Parameters:
aiterable (AsyncIterable[T]) – An asynchronous iterable to retrieve items from.
n (int) – The number of items to retrieve from the end.
- Returns:
An asynchronous iterable yielding the last
nitems of theaiterable.- Return type:
AsyncIterable[T]
Examples
>>> aiterable = arange(23) >>> [num async for num in atail(aiterable, n=4)] [19, 20, 21, 22]
Notes
The last
nitems are buffered in memory before yielding;Yields control to the event loop before producing each value.