from typing import Generic, TypeVar
T = TypeVar("T")
class A(Generic[T]):
a: T
class B(A[float], A[int]) # error
class C(A[float]):
pass
class D(C, A[int]): # no error
pass
d = D()
d.a = 1.1 # What the heck?
c: C = d # fishy
c.a = 1.1
This scenario seems quite fishy (🐟). What do you think? Leave a comment below.