-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Labels
bugmypy got something wrongmypy got something wrong
Description
Bug Report
If we creates multiple generic parents with the same generic attribute, mypy raises an error about incompatible definition
To Reproduce
from typing import Generic, TypeVar
T = TypeVar("T")
class A(Generic[T]):
x: T
class B(Generic[T]):
x: T
class C(A[str], B[str]):
pass
Raises error: Definition of "x" in base class "A" is incompatible with definition in base class "B" [misc]
Expected Behavior
The example should has no error, like in the final types case
class A:
x: str
class B:
x: str
class C(A, B):
pass
Actual Behavior
Raises an error
Your Environment
mypy==1.14.0
ApostolFet, Maclovi, jorenham and aminabbasov
Metadata
Metadata
Assignees
Labels
bugmypy got something wrongmypy got something wrong