-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Description
from typing import NamedTuple
class A:
def __init__(self) -> None:
self.tuple2 = NamedTuple('x', [('y', str), ('z', bool)])
def run2(self) -> NamedTuple:
return self.tuple2(y='y', z=True)
print(A().run2())
The script will trigger "NamedTuple" not callable mypy(error)
, not sure if this is as expected
Reference:
https://mypy.readthedocs.io/en/latest/kinds_of_types.html#named-tuples
Tested with Python37 and mypy==0.701