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 Foo: def __set_name__(self, owner: Type['Bar'], name: str) -> None: ... class Bar: foo_bar = Foo() # correctly passes class Baz: foo_baz = Foo() # should fail
mypy correctly accepts Bar.foo_var, but incorrectly accepts Baz.foo_baz
The text was updated successfully, but these errors were encountered:
I believe mypy isn't aware of __set_name__, this should be implemented.
__set_name__
I believe the generic definition of this is:
def __set_name__(self, owner: Type[Any], name: str) -> None: ...
We perhaps might be able to specialize based on the type of owner.
Sorry, something went wrong.
owner
No branches or pull requests
mypy correctly accepts Bar.foo_var, but incorrectly accepts Baz.foo_baz
The text was updated successfully, but these errors were encountered: