Re: [Python-ideas] namedtuple redesign goals

[redirecting back to list] On 07/24/2017 04:19 AM, Michel Desmoulin wrote:
Le 24/07/2017 à 13:02, Ethan Furman a écrit :
On 07/23/2017 10:47 AM, Michel Desmoulin wrote:
Um, yes, it is. Did you not read the section you snipped? [1]
How many people among those intereted by the proposal have a strong need for the type ?
Whether there is a strong need for it is largely irrelevant; it's there now, it needs to stay. If we were to remove it there would need to be a strong need for what we gain and that it outweighs the broken backward compatibility commitment that we try very hard to maintain. -- ~Ethan~ [1] My apologies for the first paragraph if this is a language translation issue and you were talking about the backwards compatibility and not the type tracking.

Le 24/07/2017 à 13:45, Ethan Furman a écrit :
You are assuming a namedtuple litteral would mean collections.namedtuple would lose the type hability. It's not the case. The litterals can be complement, not a remplacement. Accelerating namedtuple can be made by rewritting it in C. The litteral namedtuple is not necessary for that.

Michel Desmoulin writes:
Unlikely to fly in Python. We really don't like things that have "obvious semantics" based on appearance that don't have those semantics. Something like "(x=0, y=1)" is so obviously a literal creating a collections.namedtuple, the object it creates really needs to *be* a collections.namedtuple. YMMV, but I suspect most Python developers will agree with me to some extent, and most of those, pretty strongly. Steve

Le 24/07/2017 à 13:45, Ethan Furman a écrit :
You are assuming a namedtuple litteral would mean collections.namedtuple would lose the type hability. It's not the case. The litterals can be complement, not a remplacement. Accelerating namedtuple can be made by rewritting it in C. The litteral namedtuple is not necessary for that.

Michel Desmoulin writes:
Unlikely to fly in Python. We really don't like things that have "obvious semantics" based on appearance that don't have those semantics. Something like "(x=0, y=1)" is so obviously a literal creating a collections.namedtuple, the object it creates really needs to *be* a collections.namedtuple. YMMV, but I suspect most Python developers will agree with me to some extent, and most of those, pretty strongly. Steve
participants (3)
-
Ethan Furman
-
Michel Desmoulin
-
Stephen J. Turnbull