Again, you neglected to answer the question:

> what are the field names supposed to be if the datastructure is being treated 
> as a sequence, of possibly arbitrary length?



> 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.

The point is that I *don't* want to treat it as a record, and I have no reason 
to. That's precisely the point I'm making!

> the field names don't have to be valid identifiers

Yes, they do.

> if it's a sequence of arbitrary length, then why is it a tuple at all?

Why wouldn't it be? A tuple is a sequence. And a sequence can be of arbitrary 
length.

> You assume that it has to be a tuple but not a namedtuple, but a namedtuple 
> IS a tuple.

See my first question.

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

I already provided *plenty* of examples through the Sourcegraph queries. 
There's no reason for me to give you my specific code, nor does it help this 
discussion in any way, since I already gave you plenty of examples.

------- Original Message -------

On Monday, March 14th, 2022 at 7:04 PM, Chris Angelico <ros...@gmail.com> wrote:

> 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/
_______________________________________________
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/MY2EWIXDDU7CCO3ZLUCG4XFK3FNFO653/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to