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

MRAB python at mrabarnett.plus.com
Wed Jul 19 21:20:10 EDT 2017


On 2017-07-20 02:08, Guido van Rossum wrote:
> The proposal in your email seems incomplete -- there's two paragraphs on 
> the actual proposal, and the entire rest of your email is motivation. 
> That may be appropriate for a PEP, but while you're working on a 
> proposal it's probably better to focus on clarifying the spec.
> 
> Regarding that spec, I think there's something missing: given a list (or 
> tuple!) of values, how do you turn it into an 'ntuple'? That seems a 
> common use case, e.g. when taking database results like row_factory in 
> sqlite3.
> 
It could borrow from what a dict does: accept a list of 2-tuples, name 
and value.


More information about the Python-ideas mailing list