Added order by functions

This commit is contained in:
2021-07-26 15:21:57 +02:00
parent cc7755bafc
commit 0cae3428b9
7 changed files with 172 additions and 38 deletions

View File

@@ -0,0 +1,20 @@
from abc import abstractmethod
from collections import Callable
from cpl_query.extension.iterable_abc import IterableABC
class OrderedIterableABC(IterableABC):
@abstractmethod
def __init__(self, _func: Callable = None):
IterableABC.__init__(self)
self._funcs: list[Callable] = []
if _func is not None:
self._funcs.append(_func)
@abstractmethod
def then_by(self, func: Callable) -> 'OrderedIterableABC': pass
@abstractmethod
def then_by_descending(self, func: Callable) -> 'OrderedIterableABC': pass