I have used collections.namedtuple
in some code, but now I see that in Python 3.6 there is a new typing.NamedTuple
base class available in the new class style. It also appears to make type hints available for the named indexes in the tuple.
Is there any reason to continue using the older collections.namedtuple
(from Python 2.6) in newly written code, beyond compatibility with older code?
i.e. Is there a performance advantage, does it use less memory, etc.?