Changed func type from str to Callable
This commit is contained in:
@@ -16,7 +16,7 @@ class Iterable(IterableABC):
|
||||
def __init__(self):
|
||||
IterableABC.__init__(self)
|
||||
|
||||
def any(self, func: str) -> bool:
|
||||
def any(self, func: Callable) -> bool:
|
||||
return any_query(self, func)
|
||||
|
||||
def first(self) -> any:
|
||||
@@ -44,7 +44,7 @@ class Iterable(IterableABC):
|
||||
def single_or_default(self) -> Optional[any]:
|
||||
return single_or_default_query(self)
|
||||
|
||||
def where(self, func: str) -> IterableABC:
|
||||
def where(self, func: Callable) -> IterableABC:
|
||||
res = where_query(self, func)
|
||||
res.__class__ = Iterable
|
||||
return res
|
||||
|
@@ -9,7 +9,7 @@ class IterableABC(ABC, list):
|
||||
list.__init__(self)
|
||||
|
||||
@abstractmethod
|
||||
def any(self, func: str) -> bool: pass
|
||||
def any(self, func: Callable) -> bool: pass
|
||||
|
||||
@abstractmethod
|
||||
def first(self) -> any: pass
|
||||
@@ -33,4 +33,4 @@ class IterableABC(ABC, list):
|
||||
def single_or_default(self) -> Optional[any]: pass
|
||||
|
||||
@abstractmethod
|
||||
def where(self, func: str) -> 'IterableABC': pass
|
||||
def where(self, func: Callable) -> 'IterableABC': pass
|
||||
|
Reference in New Issue
Block a user