Code to repro:
#!/usr/bin/env python
from typing import Generic, TypeVar
T = TypeVar("T")
class Test(Generic[T]):
def __init__(self, a):
# type: (T) -> None
self.a = a
class StrTest(Test[str]):
pass
s = StrTest("str1")
I would expect there to be no error here, but mypy outputs the following:
test.py:15: error: Argument 1 to "StrTest" has incompatible type "str"; expected "T"