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
In the following case, Mypy complains about an invalid signature for the foo method in the implementation class, as it was missing an overload.
foo
However, the missing overload is not applicable to that subclass and should not be requested.
from __future__ import annotations from typing import overload, Generic, TypeVar T = TypeVar("T") class Interface(Generic[T]): @overload def foo(self: Interface[None]) -> int: ... @overload def foo(self, a: T) -> int: ... def foo(self, a: T | None = None) -> str | int: return 1 class Implementation(Interface[int]): def foo(self, a: int) -> int: return 2
Originally posted by @vnmabus in #13106 (comment)
The text was updated successfully, but these errors were encountered:
This appears to have been fixed in mypy 1.2.0.
Sorry, something went wrong.
Yeah, I think I remember the PR that fixed it, as well. Thanks!
No branches or pull requests
In the following case, Mypy complains about an invalid signature for the
foo
method in the implementation class, as it was missing an overload.However, the missing overload is not applicable to that subclass and should not be requested.
Originally posted by @vnmabus in #13106 (comment)
The text was updated successfully, but these errors were encountered: