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
I think this should be valid:
from typing import Callable, NamedTuple class Foo(NamedTuple): x: int def __call__(self) -> int: return self.x foo: Callable[[], int] = Foo(42)
but mypy fails with: error: Incompatible types in assignment (expression has type "Foo", variable has type "Callable[[], int]")
error: Incompatible types in assignment (expression has type "Foo", variable has type "Callable[[], int]")
The text was updated successfully, but these errors were encountered:
I want to contribute in it. I will resolve this .
Sorry, something went wrong.
Seems like it might be a problem that's specific to NamedTuples; mypy is happy with this code:
NamedTuple
from typing import Callable class Foo: def __call__(self) -> int: ... foo: Callable[[], int] = Foo()
No branches or pull requests
I think this should be valid:
but mypy fails with:
error: Incompatible types in assignment (expression has type "Foo", variable has type "Callable[[], int]")
The text was updated successfully, but these errors were encountered: