3 ms·
The Pythonic "simpler" does not mean "fewer characters" otherwise APL or Perl/Raku would be more Pythonic. Namedtuple is not strictly simpler. It implements ad
by eesmith 2y ago
The Pythonic "simpler" does not mean "fewer characters" otherwise APL or Perl/Raku would be more Pythonic.
Namedtuple is not strictly simpler. It implements additional features which would not be in an frozen dataclass, which makes "simpler" a personal bias.
I've been using Python continuously since 1998 and well remember the "look before you leap" vs. "ask for forgiveness not for permission" debate from the bygone comp.lang.python forum. And I learned the concept of "easier to ask for forgiveness" from the 60 Minutes interview with Grace Hopper back in the 1980s.
That have nothing to do with this issue, which is one of taking on an API burden without due consideration simply because it's less typing.