I have a parent class which is declared as a generic, an abstract subclass and a concrete implementation of that subclass, which declares the generic type:
MyType = TypeVar('MyType')
class A(Generic[MyType]):
a: MyType
class B(Generic[MyType], A[MyType]):
pass
class C(B[int]):
pass
But this doesn't forward the generic declaration from C to A, so the type of a is not int. Is there a correct way to do this? Tried searching both SO and python docs but could not find anything.