We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
from typing import Type class A: pass def deco(cls) -> Type[A]: return A @deco class B: pass def func(cls: Type[A]): assert cls is A func(B)
Running mypy on that code causes this error:
hoge.py:16: error: Argument 1 to "func" has incompatible type "B"; expected Type[A]
mypy version is mypy 0.511-88e8ef28be2465d1693ace4d39cd422987a97220-dirty.
mypy 0.511-88e8ef28be2465d1693ace4d39cd422987a97220-dirty
I would expect it to correctly detect the type of B.
B
The text was updated successfully, but these errors were encountered:
This is a duplicate of #3135.
Sorry, something went wrong.
Yes, this is a duplicate of a more "broad" bug - mypy ignores class decorators altogether.
No branches or pull requests
Running mypy on that code causes this error:
hoge.py:16: error: Argument 1 to "func" has incompatible type "B"; expected Type[A]
mypy version is
mypy 0.511-88e8ef28be2465d1693ace4d39cd422987a97220-dirty
.I would expect it to correctly detect the type of
B
.The text was updated successfully, but these errors were encountered: