I would actually disadvice the use of namedtuple in favor of dataclass (or at least NamedTuple). This is mainly for typehinting (which is a topic completely missing from the article.), but also for default parameter, mutability, and inheritance. Please, don't promot namedtuple.
3
u/MegaIng Apr 06 '19 edited Apr 06 '19
I would actually disadvice the use of
namedtuplein favor ofdataclass(or at leastNamedTuple). This is mainly for typehinting (which is a topic completely missing from the article.), but also for default parameter, mutability, and inheritance. Please, don't promotnamedtuple.