This repository has been archived by the owner on Sep 16, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 9
It seems that the new mypy doesn't type the load results as before. #132
Labels
mypy
Concerns mypy
Comments
Seems mypy decided to change behaviour… |
from typing import *
T = TypeVar('T')
def create(t: Type[T]) -> T:
...
reveal_type(create(int))
reveal_type(create(str))
reveal_type(create(List[int]))
reveal_type(create(Dict[int, int]))
reveal_type(create(Tuple[int]))
reveal_type(create(Union[int,str]))
reveal_type(create(Optional[int])) It actually never worked!
|
Oh wow that breaks a lot of code. |
Well the new mypy rejects it completely instead of inferring Any, the old one only works for some types but not all, so the typechecking is not as strong as I thought. |
@thomascellerier I created an issue on mypy, let's see what they say about this. The good news is that if the top level is a dataclass or nameduple, it works :D |
ltworf
added a commit
to ltworf/relational
that referenced
this issue
Aug 24, 2020
ltworf
added a commit
to ltworf/relational
that referenced
this issue
Aug 24, 2020
Something seems to be moving python/mypy#9773 |
There is a PEP for review https://mail.python.org/archives/list/[email protected]/thread/7TDCBWT4RAYDJUQJ3B5NKXTQDUO5SIW2/ |
Closing, since it has nothing to do with typedload |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Investigate and possibly fix.
The text was updated successfully, but these errors were encountered: