Python: All type hints errors in subclass constructure seems ignored
问题 I have the following code with python type hints It has a bunch of errors. All erros in code are found by mypy but not the errors in constructor of S. Why? I cannot find out what is happening thanks code: import typing class T(object): def __init__(self, a: int, b: str = None) -> None: self.a = a self.b: typing.Union[str, None] = b self._callback_map: typing.Dict[str, str] = {} class S(T): def __init__(self): super().__init__(self, 1, 2) self._callback_map[1] = "TOTO" s = T(1, 1) t = T(1, b=2