New GitHub issue #119782 from Gouvernathor:<br>

<hr>

<pre>
typing.NamedTuple doesn't support using a metaclass, or multiple inheritance with classes having metaclasses (such as abc.ABC(Meta)), because NamedTuple uses an undocumented metaclass underhand.
That limitation is not documented.
Since NamedTuple is a function and not a real instance of that metaclass, it's impossible to make your own subclass of both `type(NamedTuple)` (which is really `function`) and `abc.ABCMeta` in my case.

It is possible to use collections.namedtuple instead, but the syntax is obviously not as good and involves repetitions, names being put under quotes, and so on.

Using the undocumented `typing.NamedTupleMeta` metaclass, it is possible to solve the issue. So, I think the NamedTupleMeta should be documented for that use case.

One difference with ABC/ABCMeta is that using ABCMeta _replaces_ the use of ABC, whereas you apparently still need to have NamedTuple as a "base class" (even though it's not a class) when using NamedTupleMeta or a submetaclass.
I think this specificity should be explained (and possibly lifted at a later time if relevant), but that it's not blocking the feature from being relied upon and documented.
</pre>

<hr>

<a href="https://github.com/python/cpython/issues/119782">View on GitHub</a>
<p>Labels: docs</p>
<p>Assignee: </p>