[Python-ideas] namedtuple literals [Was: RE a new namedtuple]
Alexander Belopolsky
alexander.belopolsky at gmail.com
Wed Jul 19 21:35:35 EDT 2017
On Wed, Jul 19, 2017 at 9:08 PM, Guido van Rossum <guido at python.org> wrote:
> The proposal in your email seems incomplete
The proposal does not say anything about type((x=1, y=2)). I assume
it will be the same as the type currently returned by namedtuple(?, 'x
y'), but will these types be cached? Will type((x=1, y=2)) is
type((x=3, y=4)) be True?.
> Regarding that spec, I think there's something missing: given a list (or
> tuple!) of values, how do you turn it into an 'ntuple'?
Maybe type((x=1, y=2))(values) will work?
More information about the Python-ideas
mailing list