mirror of
https://github.com/aljazceru/bitfinex-api-py.git
synced 2025-12-20 07:14:20 +01:00
Add and implement notification.py in root package (bfxapi).
This commit is contained in:
@@ -8,7 +8,7 @@ class _Serializer(Generic[T]):
|
||||
def __init__(self, name: str, labels: List[str], IGNORE: List[str] = [ "_PLACEHOLDER" ]):
|
||||
self.name, self.__labels, self.__IGNORE = name, labels, IGNORE
|
||||
|
||||
def __serialize(self, *args: Any, skip: Optional[List[str]]) -> Iterable[Tuple[str, Any]]:
|
||||
def _serialize(self, *args: Any, skip: Optional[List[str]] = None) -> Iterable[Tuple[str, Any]]:
|
||||
labels = list(filter(lambda label: label not in (skip or list()), self.__labels))
|
||||
|
||||
if len(labels) > len(args):
|
||||
@@ -19,4 +19,4 @@ class _Serializer(Generic[T]):
|
||||
yield label, args[index]
|
||||
|
||||
def parse(self, *values: Any, skip: Optional[List[str]] = None) -> T:
|
||||
return cast(T, dict(self.__serialize(*values, skip=skip)))
|
||||
return cast(T, dict(self._serialize(*values, skip=skip)))
|
||||
Reference in New Issue
Block a user