Unpacking a NamedTuple subclass uses superclass' types #8663
Labels
bug
mypy got something wrong
topic-inheritance
Inheritance and incompatible overrides
topic-named-tuple
If you subclass an existing NamedTuple to provide more specific type declarations for some of the fields, and then unpack an instance of that NamedTuple, mypy 0.770 gets its type information from the superclass, not the subclass. Minimal reproduction:
The last line reports:
I expected no error, since accessing the field by name works fine.
The text was updated successfully, but these errors were encountered: