In both python 3.7 and 3.8,
typing.NamedTuple had some strange behaviour regarding multiple inheritance. This behaviour was solved in 3.9 (bpo-36517), but this fix also barred me from a feature very close to my heart: the generic named tuple
T = TypeVar('T')
class LLNode(NamedTuple, Generic[T]):
bpo-36517 was committed because any additional features of other classes would be missing from the NamedTuple class at runtime. But Generic has no features at runtime, and thus this snippet actually works as expected in python 3.7/8. But in 3.9, it raises a TypeError, as bpo-36517 completely barred
any other bases in a typing.NameTuple subclass.
I propose that instead of wholesale barring multiple inheritance in NamedTuple, NamedTuple will allow some pre-defined bases alongside it. It will only allow do-nothing mixins with no runtime features (I can only think of `Generic` Aliases atm, but perhaps others exist). As before, these bases will be actually omitted from the class's bases at runtime.