> A namedtuple IS a sequence. It is a tuple. They are deliberately designed to > be drop-in replacements for tuples.
I meant that they're not meant to be addressed as sequences. That's the whole point of namedtuple: to avoid doing that. And the first point still applies. ------- Original Message ------- On Monday, March 14th, 2022 at 12:19 PM, Chris Angelico <[email protected]> wrote: > On Tue, 15 Mar 2022 at 03:16, wfdc [email protected] wrote: > > > > Yes, and dataclasses and namedtuples support this concept very nicely. > > > You still haven't shown why neither works. > > > > 1. They're less efficient, as Christopher pointed out long ago. > > > > 2. They're not sequences, so conceptually the wrong tool for the job. > > A namedtuple IS a sequence. It is a tuple. They are deliberately > > designed to be drop-in replacements for tuples. > > ChrisA > > _______________________________________________ > > Python-ideas mailing list -- [email protected] > > To unsubscribe send an email to [email protected] > > https://mail.python.org/mailman3/lists/python-ideas.python.org/ > > Message archived at > https://mail.python.org/archives/list/[email protected]/message/OYMJH6445PZ2P4LE5SGLH3QKXV2FHNH5/ > > Code of Conduct: http://python.org/psf/codeofconduct/ _______________________________________________ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/[email protected]/message/HPTTY7SIR6C7MFQID7WE65KDTXMFCTFU/ Code of Conduct: http://python.org/psf/codeofconduct/
