Closed
Description
Minimal repro case:
from typing import Iterable
class A:
a: Iterable[str] = ("a", )
class B(A):
a = ("a", "b")
class C(B):
a = ("a", "b", "c")
And the error:
a.py:10: error: Incompatible types in assignment (expression has type "Tuple[str, str, str]", base class "B" defined the type as "Tuple[str, str]")
The error is reported on the assignment in C
.
I would have expected that B.a would have the same type as A.a since B.a doesn't have an explicit type.
Maybe relates to #4547 or #2510, or maybe I'm just expecting mypy to do something that it won't :)
Metadata
Metadata
Assignees
Labels
No labels