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?

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

On Monday, March 14th, 2022 at 6:19 PM, Greg Ewing 
<greg.ew...@canterbury.ac.nz> wrote:

> On 15/03/22 6:14 am, wfdc via Python-ideas wrote:
>
> > The whole point is that namedtuples let you use named fields rather than 
> > indices. That's the point. That's the purpose.
>
> I would say the point of namedtuple is to let you use either field
>
> names or indices, whichever makes the most sense for what you're
>
> doing at the time. Otherwise why not just use a regular class?
>
> --
>
> Greg
>
> _______________________________________________
>
> 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/6Z3SGL4AJEBS2W4URZ5D4UH4KKPC6IAX/
>
> 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/BDSIDWEQO3KFWQBN2EFSSWMHOJJS6OGZ/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to