Why can we inherit `typing.NamedTuple`?
After Python 3.6, we have typing.NamedTuple, which is a typed version of collections.namedtuple(), we can inherit it like a class: class Employee(NamedTuple): name: str id: int Compared with collections.namedtuple, this syntax is more beautiful, but I still can’t understand its implementation, whether we look at typing.py file, or do some simple tests, we will find… Read More Why can we inherit `typing.NamedTuple`?