Closed sobolevn closed 5 months ago
It is defined as SaveHooks = List[Callable[[T], None]], so we need to set T explicitly as SaveHooks[T]
SaveHooks = List[Callable[[T], None]]
T
SaveHooks[T]
Problem that my mypy detects:
mypy
tests/plugins/identity/verification.py:26: error: No overload variant of "m" of "Factory" matches argument type "Any" [call-overload] tests/plugins/identity/verification.py:26: note: Possible overload variants: tests/plugins/identity/verification.py:26: note: def m(self, model: str, pre_save: list[Callable[[Model], Any]] | None, post_save: list[Callable[[Model], Any]] | None, seed: Any | bytearray | int | None, quantity: None) -> Callable[..., Model] tests/plugins/identity/verification.py:26: note: def m(self, model: Any, pre_save: list[Callable[[Any], None]] | None, post_save: list[Callable[[Any], None]] | None, seed: Any | bytearray | int | None, quantity: None) -> Callable[..., Any] tests/plugins/identity/verification.py:26: note: def m(self, model: str, pre_save: list[Callable[[Model], Any]] | None, post_save: list[Callable[[Model], Any]] | None, seed: Any | bytearray | int | None, quantity: int | None) -> Callable[..., list[Model]] tests/plugins/identity/verification.py:26: note: def m(self, model: Any, pre_save: list[Callable[[Any], None]] | None, post_save: list[Callable[[Any], None]] | None, seed: Any | bytearray | int | None, quantity: int | None) -> Callable[..., list[Any]]
coverage: 90.855%. remained the same when pulling d51b94b1bb3e6d35a7097bd1e81661051397be7d on sobolevn:patch-4 into f7414aa9d92ae8fd01c3baff909d938fb85c82aa on fcurella:master.
It is defined as
SaveHooks = List[Callable[[T], None]]
, so we need to setT
explicitly asSaveHooks[T]
Problem that my
mypy
detects: