aioplus.atriplewise

aioplus.atriplewise(aiterable, /)

Return successive overlapping triplets taken from the input aiterable.

Parameters:

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

Returns:

An asynchronous iterable yielding triplets of elements.

Return type:

AsyncIterable of tuple[T, T, T]

Examples

>>> aiterable = arange(23)
>>> [triplet async for triplet in atriplewise(aiterable)]
[(0, 1, 2), (1, 2, 3), ..., (19, 20, 21), (20, 21, 22)]