aioplus.areversed

aioplus.areversed(aiterable, /)

Return a reverse iterator.

Parameters:

aiterable (AsyncIterable of T) – An asynchronous iterable to be reversed.

Returns:

An asynchronous iterable yielding the objects in reverse order.

Return type:

AsyncIterable of T

Examples

>>> aiterable = arange(23)
>>> [num async for num in areversed(aiterable)]
[22, 21, 20, 19, 18, ..., 4, 3, 2, 1, 0]

Notes

  • Entire iterable is buffered in memory before yielding results;

  • Yields control to the event loop before producing each value.

See also

reversed()