Re:Namedtuple in a Post-Dataclasses World
by palotasb on Wednesday July 21, 2021 @11:58AM
(#27907963)
NamedTuple or namedtuple instances are tuple instances that have the same properties that regular tuples have. They are immutable (you cannot reassign their fields), you can index into them (a[0], a[1] instead of a.x and a.y), you can unpack them with *a. They can have methods like regular classes can, including additional @property methods. A NamedTuple class cannot inherit from another class, not even other named tuples.
[ Parent
| on HN ]
There are no comments on this comment yet.