[Python-ideas] namedtuple redesign goals

Stephen J. Turnbull turnbull.stephen.fw at u.tsukuba.ac.jp
Tue Jul 25 05:05:11 EDT 2017

Michel Desmoulin writes:

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

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.


More information about the Python-ideas mailing list