1
0
mirror of https://github.com/microsoft/qlib.git synced 2026-07-09 22:10:56 +08:00

black format

This commit is contained in:
Young
2020-11-21 15:34:15 +00:00
parent e5923333f5
commit 89977320e3
5 changed files with 20 additions and 18 deletions

View File

@@ -10,14 +10,14 @@ class Serializable:
Serializable behaves like pickle.
But it only saves the state whose name **does not** start with `_`
"""
def __init__(self):
self._dump_all = False
self._exclude = []
def __getstate__(self) -> dict:
return {
k: v
for k, v in self.__dict__.items() if k not in self.exclude and (self.dump_all or not k.startswith("_"))
k: v for k, v in self.__dict__.items() if k not in self.exclude and (self.dump_all or not k.startswith("_"))
}
def __setstate__(self, state: dict):