Added avg query

This commit is contained in:
2021-07-27 09:26:30 +02:00
parent 0f85d4b9bc
commit e0b7728719
5 changed files with 60 additions and 2 deletions

View File

@@ -1,5 +1,5 @@
from abc import ABC, abstractmethod
from typing import Optional, Callable
from typing import Optional, Callable, Union
class IterableABC(ABC, list):
@@ -14,6 +14,9 @@ class IterableABC(ABC, list):
@abstractmethod
def all(self, func: Callable) -> bool: pass
@abstractmethod
def average(self, t: type, func: Callable) -> Union[int, float, complex]: pass
@abstractmethod
def first(self) -> any: pass