Re: [Python-ideas] namedtuple literals [Was: RE a new namedtuple]

2017-07-23 Thread Stephen J. Turnbull
C Anthony Risinger writes: > A tuple is a tuple is a tuple. No types. Just convenient accessors. That's not possible, though. A *tuple* is an immutable collection indexed by the natural numbers, which is useful to define as a single type precisely because the natural numbers are the canonical

Re: [Python-ideas] namedtuple literals [Was: RE a new namedtuple]

2017-07-23 Thread C Anthony Risinger
On Jul 23, 2017 1:56 PM, "MRAB" wrote: On 2017-07-23 17:08, Todd wrote: > On Jul 20, 2017 1:13 AM, "David Mertz" > wrote: > > I'm concerned in the proposal about losing access to type > information (i.e. name) in this

Re: [Python-ideas] namedtuple literals [Was: RE a new namedtuple]

2017-07-23 Thread MRAB
On 2017-07-23 17:08, Todd wrote: On Jul 20, 2017 1:13 AM, "David Mertz" > wrote: I'm concerned in the proposal about losing access to type information (i.e. name) in this proposal. For example, I might write some code like this now:

Re: [Python-ideas] namedtuple literals [Was: RE a new namedtuple]

2017-07-23 Thread Markus Meskanen
23.7.2017 20.59 "Michel Desmoulin" wrote: I'm not sure why everybody have such a grip on the type. When we use regular tuples, noone care, it's all tuples, no matter what. Well in that case, let's make all those namedtuple and be done with it. If somebody really

Re: [Python-ideas] namedtuple literals [Was: RE a new namedtuple]

2017-07-23 Thread Michel Desmoulin
I'm not sure why everybody have such a grip on the type. When we use regular tuples, noone care, it's all tuples, no matter what. Well in that case, let's make all those namedtuple and be done with it. If somebody really needs a type, this person will either used collections.namedtuple the old

Re: [Python-ideas] namedtuple literals [Was: RE a new namedtuple]

2017-07-23 Thread Todd
On Jul 20, 2017 1:13 AM, "David Mertz" wrote: I'm concerned in the proposal about losing access to type information (i.e. name) in this proposal. For example, I might write some code like this now: >>> from collections import namedtuple >>> Car = namedtuple("Car", "cost hp