Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork3.1k
Closed
Description
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 reportsmain.py:13: error: Signature of "f" incompatible with supertype "A".
This is incorrect:B is anA[int], so it doesn't matter that it doesn't implement the second overload.