typing.NamedTuple
collides based on field order and type, doesn't consider class name or field names
#6623
Labels
bug
mypy got something wrong
false-positive
mypy gave an error on correct code
priority-1-normal
topic-named-tuple
topic-overloads
I expect this code to typecheck, since
A
andB
are nominally different. Note that changing the field type or adding additional fields results inA
andB
no longer being considered overlapping, but changing the field name does not, so it appears that type-identity for NamedTuples is determined solely by field type and order.This is python 3.6.4 and mypy 0.700. I have not attempted to reproduce using git-master.
repro:
resulting mypy error:
The text was updated successfully, but these errors were encountered: