2021-07-26 15:32:28 +02:00
|
|
|
from collections import Callable
|
|
|
|
|
2021-07-25 19:15:02 +02:00
|
|
|
from cpl_query._query.where_query 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
|