aioplus.acount¶
- aioplus.acount(start=0, step=1)¶
Return evenly spaced values beginning with
start.- Parameters:
start (int, default 0) – The initial value. Must be an object supporting
object.__index__().step (int, default 1) – The difference between consecutive values. Must be an object supporting
object.__index__().
- Returns:
An infinite asynchronous iterable yielding integers, starting from
startand incremented bystep.- Return type:
AsyncIterable of int
Examples
>>> import asyncio >>> >>> from aioplus import acount >>> >>> async def main() -> None: >>> '''Run the program.''' >>> async for num in acount(start=23, step=4): >>> print(num) >>> >>> if __name__ == '__main__': >>> asyncio.run(main())
Notes
Yields control to the event loop before producing each value.
See also