aioplus.aall

async aioplus.aall(aiterable, /)

Return True if all elements of the async iterable evaluate to True.

Parameters:

aiterable (AsyncIterable of SupportsBool) – An asynchronous iterable of objects supporting object.__bool__().

Returns:

True if all elements evaluate to True, or if the iterable is empty. False if any element evaluates to False.

Return type:

bool

Examples

>>> import asyncio
>>>
>>> from aioplus import aall, arange
>>>
>>> async def main() -> None:
>>>     '''Run the program.'''
>>>     aiterable = (num > 0 async for num in arange(2304))
>>>     flg = await aall(aiterable)
>>>
>>> if __name__ == '__main__':
>>>     asyncio.run(main())

Notes

  • Short-circuits on the first object that evaluates to False.

See also

all()