You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
arg-type error when inheriting from NamedTuple #11160
mypy does not identify NamedTuple as a base type when passing objects from a subclass in function calls.
However, everything works as expected when using a custom base class.
This happens because Bar is not considered neither nominal nor structural subtype of NamedTuple instance type. NamedTuple is not even listed in Bar's mro. This special case can be easily added. 🤖
Activity
sobolevn commentedon Sep 21, 2021
This happens because
Baris not considered neither nominal nor structural subtype ofNamedTupleinstance type.NamedTupleis not even listed inBar'smro. This special case can be easily added. 🤖Adds support for `NamedTuple` subtyping (#11162)
Adds support for `NamedTuple` subtyping (python#11162)