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"
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4