Skip to content

Commit 32b0376

Browse files
committed
Fix type error with newer mypy
1 parent 4a91519 commit 32b0376

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

atomdb/base.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
from atom.atom import AtomMeta
4141

4242
T = TypeVar("T")
43+
M = TypeVar("M", bound="Model")
4344
ScopeType = DictType[Union[str, bytes], Any]
4445
StateType = DictType[str, Any]
4546
logger = logging.getLogger("atomdb")
@@ -488,7 +489,7 @@ async def __restorestate__(
488489
objects: ModelManager = ModelManager()
489490

490491
@classmethod
491-
async def restore(cls: Type[T], state: StateType, **kwargs: Any) -> T:
492+
async def restore(cls: Type[M], state: StateType, **kwargs: Any) -> M:
492493
"""Restore an object from the database state"""
493494
obj = cls.__new__(cls)
494495
await obj.__restorestate__(state)

0 commit comments

Comments
 (0)