Reduced test case (mypy-playground):
from typing import Generic, TypeVar
T = TypeVar("T", float, int)
class C(Generic[T]):
def __init__(self, i: T) -> None:
self.i: T = i
class B(C[T]):
def __init__(self, i: T) -> None:
super().__init__(i)
main.py: note: In member "__init__" of class "B":
main.py:13:26: error: Argument 1 to "__init__" of "C" has incompatible type "float"; expected "T" [arg-type]
main.py:13:26: error: Argument 1 to "__init__" of "C" has incompatible type "int"; expected "T" [arg-type]
Found 2 errors in 1 file (checked 1 source file)
Originally posted by @leandro-lucarella-frequenz in #13566 (comment) (this is a very similar issue but not exactly the same)