sh_cpl/src/cpl_query/_query/any.py

17 lines
506 B
Python
Raw Normal View History

2021-07-26 15:32:28 +02:00
from collections import Callable
2021-07-27 11:22:29 +02:00
from cpl_query._query.where import where_query
2021-07-27 09:41:51 +02:00
from cpl_query.exceptions import ArgumentNoneException, ExceptionArgument
2021-07-25 19:15:02 +02:00
from cpl_query.extension.iterable_abc import IterableABC
2021-07-26 15:32:28 +02:00
def any_query(_list: IterableABC, _func: Callable) -> bool:
2021-07-27 09:41:51 +02:00
if _list is None:
raise ArgumentNoneException(ExceptionArgument.list)
if _func is None:
raise ArgumentNoneException(ExceptionArgument.func)
2021-07-25 19:15:02 +02:00
result = where_query(_list, _func)
return len(result) > 0