aioplus.atabulate

aioplus.atabulate(afunc, /, *, start=0)

Return await afunc(0), await afunc(1), await afunc(2), etc.

Parameters:
  • afunc (Callable[[int], Awaitable[R]]) – Callable.

  • start (int) –

Returns:

Iterator.

Return type:

AsyncIterator[R]

Examples

>>> afunc = awaitify(lambda x: x * x)
>>> [num async for num in atabulate(afunc)]
[0, 1, 4, 9, 16, 25, 36, 49, ...]