projects
/
pyutils.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e70231d
)
Add type hint for class arg.
author
Scott Gasch
<
[email protected]
>
Thu, 8 Jun 2023 17:17:09 +0000
(10:17 -0700)
committer
Scott Gasch
<
[email protected]
>
Thu, 8 Jun 2023 17:17:09 +0000
(10:17 -0700)
src/pyutils/persistent.py
patch
|
blob
|
history
diff --git
a/src/pyutils/persistent.py
b/src/pyutils/persistent.py
index d3674b51eade56ea1d54bd659a00f63135fad98a..18d99c75a2135d4d76812b2291fca458a0da555f 100644
(file)
--- a/
src/pyutils/persistent.py
+++ b/
src/pyutils/persistent.py
@@
-34,7
+34,7
@@
import functools
import logging
import re
from abc import ABC, abstractmethod
import logging
import re
from abc import ABC, abstractmethod
-from typing import Any, Optional
+from typing import Any, Optional
, Type
from overrides import overrides
from overrides import overrides
@@
-60,7
+60,7
@@
class Persistent(ABC):
@classmethod
@abstractmethod
@classmethod
@abstractmethod
- def load(cls) -> Any:
+ def load(cls
: Type
) -> Any:
"""Load this thing from somewhere and give back an instance which
will become the global singleton and which may (see
below) be saved (via :meth:`save`) at program exit time.
"""Load this thing from somewhere and give back an instance which
will become the global singleton and which may (see
below) be saved (via :meth:`save`) at program exit time.
@@
-253,7
+253,7
@@
class JsonFileBasedPersistent(FileBasedPersistent):
@classmethod
@overrides
@classmethod
@overrides
- def load(cls) -> Any:
+ def load(cls
: Type
) -> Any:
filename = cls.get_filename()
if cls.should_we_load_data(filename):
logger.debug("Trying to load state from %s", filename)
filename = cls.get_filename()
if cls.should_we_load_data(filename):
logger.debug("Trying to load state from %s", filename)