Given this code:
fromtypingimportoverload, TypeVar, GenericT=TypeVar("T", str, int)
classA(Generic[T]):
@overloaddeff(self: A[int]) ->int: ...
@overloaddeff(self: A[str]) ->str: ...
deff(self): ...
classB(A[int]):
deff(self) ->int: ...https://mypy-play.net/?mypy=latest&python=3.10&gist=736b946030f3c52e14c712ce7e95464c
mypy 0.981 reports main.py:13: error: Signature of "f" incompatible with supertype "A".
This is incorrect: B is an A[int], so it doesn't matter that it doesn't implement the second overload.
Given this code:
https://mypy-play.net/?mypy=latest&python=3.10&gist=736b946030f3c52e14c712ce7e95464c
mypy 0.981 reports
main.py:13: error: Signature of "f" incompatible with supertype "A".This is incorrect:
Bis anA[int], so it doesn't matter that it doesn't implement the second overload.