This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author campkeith
Recipients campkeith
Date 2018-07-20.21:08:00
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1532120880.21.0.56676864532.issue34175@psf.upfronthosting.co.za>
In-reply-to
Content
Find the test case below:

----
from typing import NamedTuple

class Foo(NamedTuple):
    alpha: int
    index: int
----

This results in the following error when run through type-checking with mypy:

----
% mypy --version
mypy 0.620
% mypy go.py
go.py:5: error: Incompatible types in assignment (expression has type "int", base class "tuple" defined the type as "Callable[[Tuple[int, ...], Any, int, int], int]")
----

When I instantiate this class in the python interpreter, I have no problem accessing the "index" member, so I suspect this is a bug in the type checker.
History
Date User Action Args
2018-07-20 21:08:00campkeithsetrecipients: + campkeith
2018-07-20 21:08:00campkeithsetmessageid: <1532120880.21.0.56676864532.issue34175@psf.upfronthosting.co.za>
2018-07-20 21:08:00campkeithlinkissue34175 messages
2018-07-20 21:08:00campkeithcreate