aioplus.aany

async aioplus.aany(aiterable, /)

Return True if any element of the async iterable evaluates to True.

Parameters:

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

Returns:

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

Return type:

bool

Examples

>>> aiterable = arange(23)
>>> await aany(aiterable)
True

Notes

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

See also

any()