We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4a91519 commit 32b0376Copy full SHA for 32b0376
atomdb/base.py
@@ -40,6 +40,7 @@
40
from atom.atom import AtomMeta
41
42
T = TypeVar("T")
43
+M = TypeVar("M", bound="Model")
44
ScopeType = DictType[Union[str, bytes], Any]
45
StateType = DictType[str, Any]
46
logger = logging.getLogger("atomdb")
@@ -488,7 +489,7 @@ async def __restorestate__(
488
489
objects: ModelManager = ModelManager()
490
491
@classmethod
- async def restore(cls: Type[T], state: StateType, **kwargs: Any) -> T:
492
+ async def restore(cls: Type[M], state: StateType, **kwargs: Any) -> M:
493
"""Restore an object from the database state"""
494
obj = cls.__new__(cls)
495
await obj.__restorestate__(state)
0 commit comments