NamedTuple subclassing NamedTuple · Issue #427 · python/typing (original) (raw)
I naively thought that since I can write
class A(NamedTuple): x: int y: int
I would also be able to subclass this:
class B(A): z: int
That is accepted syntactically and at runtime but no new __new__
method is generated so calling B(1, 2, 3)
is flagged as an error (too many arguments) by both mypy and runtime.