You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#!/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"
The text was updated successfully, but these errors were encountered:
Code to repro:
I would expect there to be no error here, but mypy outputs the following:
The text was updated successfully, but these errors were encountered: