Bug Report
If I have a generic class with an attribute of a generic type, when creating a concrete subclass, overriding that attribute with a correctly typed property raises an error. Similar to #4125
To Reproduce
fromtypingimportTypeVar, GenericT=TypeVar("T")
classA(Generic[T]):
def__init__(self, val: T):
self.member: T=valclassB(A[str]):
@propertydefmember(self) ->str:
return"bar"@member.setterdefmember(self, val: str):
passActual Behavior
property_issue.py:10: error: Signature of "member" incompatible with supertype "A" [override]
property_issue.py:10: note: Superclass:
property_issue.py:10: note: T
property_issue.py:10: note: Subclass:
property_issue.py:10: note: str
Your Environment
- Mypy version used: 1.9.0
- Mypy command-line flags: -
- Mypy configuration options from
mypy.ini (and other config files): - - Python version used: 3.9.13
Bug Report
If I have a generic class with an attribute of a generic type, when creating a concrete subclass, overriding that attribute with a correctly typed property raises an error. Similar to #4125
To Reproduce
Actual Behavior
Your Environment
mypy.ini(and other config files): -