[Python-ideas] A namedtuple literal.

random832 at fastmail.us random832 at fastmail.us
Thu Apr 3 15:28:45 CEST 2014


On Wed, Apr 2, 2014, at 11:20, Yury Selivanov wrote:
> 
> On 2014-04-02, 12:40 AM, Eric Snow wrote:
> > (Inspired by https://mail.python.org/pipermail/python-ideas/2010-October/008532.html)
> >
> > (color: c, position: p)
> While it looks extremely neat, there is one design flaw that is shared 
> with JavaScript's object literals.
...
> So for Python, I think that having unquoted keys in literals is a bad
> idea.

But namedtuple elements are attributes. This is like objecting to having
to do setattr(o,key) instead of o.key when key is in a variable.


More information about the Python-ideas mailing list