Closed
Description
On the code below, mypy
0.620 (executed as mypy foo.py
) under python 3.6.3 says:
foo.py:17: error: Too few arguments for "FR"
despite the fact that the code is fine. I expect no warnings.
from typing import Type, NamedTuple
_FR = NamedTuple('_FR', [
('forward', str),
('reverse', str)
])
class FR(_FR):
def __new__(cls: Type['FR'], fw: str) -> 'FR':
# The ignore on the next line works around a bug
# reported as fixed https://github.com/python/typeshed/issues/2091
#
# NOTE: it is still not fixed with
# mypy-0.630+dev.b2d61741623f2a0573f2b1bdb8391ceed862cf69
return super().__new__(cls, fw, fw[::-1]) # type: ignore
print(FR('stuff'))
I also tried executing with latest from git
(mypy-0.630+dev.b2d61741623f2a0573f2b1bdb8391ceed862cf69
) and the error persists.
Metadata
Metadata
Assignees
Labels
No labels