aspis.common.any

aspis.common.any(fn, arr)

Returns True if any element in the array satisfies the predicate.

Parameters:
  • fn (Callable) – The predicate function.

  • arr (Sequence) – The array to be tested.

Returns:

True if any element satisfies the predicate; otherwise, False.

Return type:

bool

Example

>>> any_satisfy(lambda x: x > 5, [1, 2, 6, 3])
True
>>> any_satisfy(lambda x: x > 10, [1, 2, 6, 3])
False