On Tue, 15 Mar 2022 at 10:02, wfdc via Python-ideas
<python-ideas@python.org> wrote:
>
> See my previous response to Chris:
>
> > What are the named fields supposed to be if the datastructure is being 
> > treated as a sequence? Indices again? Then what's the point of using 
> > namedtuple rather than tuple in the first place?
>
> > And, by the way, field names must be valid identifiers.
>
> > So again, what are the field names supposed to be if the datastructure is 
> > being treated as a sequence, of possibly arbitrary length?
>

It's very hard to answer a question that is fundamentally based on a
misunderstanding of namedtuples. Since a namedtuple *is* supposed to
be both a sequence and a record, the names are part of the record
interface, and the sequence is still part of that. Also, the field
names don't have to be valid identifiers (although they usually will).
But if it's a sequence of arbitrary length, then why is it a tuple at
all? You assume that it has to be a tuple but not a namedtuple, but a
namedtuple IS a tuple.

Do you see why we've been asking you to SHOW YOUR CODE?

I am done. I'm not going to further respond in this thread until there
is some actual code to discuss.

ChrisA
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/SAHYE2XVOAFBJ7UO5ZTECH4GVTEA5XKC/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to