Open
Description
Feature or enhancement
Proposal:
Currently this code is failing:
class A:
pass
class B(A, typing.NamedTuple):
x: int
Raising:
TypeError: can only inherit from a NamedTuple type and Generic
But this code is not:
class A:
pass
class _B(typing.NamedTuple):
x: int
class B(A, _B):
pass
B(x=1)
I believe those 2 snippets are mostly equivalent (the final B
class behave the same), so it's confusing and force boilerplate that class B(A, typing.NamedTuple):
fail.
Has this already been discussed elsewhere?
This is a minor feature, which does not need previous discussion elsewhere
Links to previous discussion of this feature:
No response