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
If have following code
from typing import Type, TypeVar T = TypeVar("T") class Foo: @classmethod def load(cls: Type[T]) -> T: ... class Bar(Foo): @classmethod def load(cls: Type[Bar]) -> Bar: return cls()
which, fails to type check, with:
test.pyi:11: error: Return type "Bar" of "load" incompatible with return type <nothing> in supertype "Foo"
To my confusion it type check if I modify parent signature to:
from typing import Type, TypeVar T = TypeVar("T") class Foo: @classmethod def load(cls: T) -> T: ... class Bar(Foo): @classmethod def load(cls: Type[Bar]) -> Bar: return cls()
The text was updated successfully, but these errors were encountered:
Thanks for reporting!
This looks like another duplicate of #2511
Sorry, something went wrong.
No branches or pull requests
If have following code
which, fails to type check, with:
To my confusion it type check if I modify parent signature to:
The text was updated successfully, but these errors were encountered: