[Python-ideas] Fwd: Anonymous namedtuples

Sven R. Kunze srkunze at mail.de
Tue Apr 19 17:20:30 EDT 2016

On 19.04.2016 19:35, Guido van Rossum wrote:
> That's essentially what the (x=12, y=16) proposal is about, IIUC -- it 
> would just be a single new type, so (x=12, y=16).__class__ would be 
> the same class object as (a='', b=3.14).

The proposal reminds me of JavaScript's "object".

So, "(x=12, y=16).__class__ == type(object())"?

> But I have serious reservations about that idiom too.

Me, too. I don't fully support this kind of on-the-fly construction as 
it is the same for closures. But that might just be my personal feeling 
because as such they escape proper testing and type support by IDEs 
(which reminds me strongly about Web development with JavaScript). On 
the other side, it allows ultra-rapid prototyping from which one can 
strip down to "traditional development" step by step when needed (using 
classes, tests etc.).

This said, what are the reasons for your reservations?


More information about the Python-ideas mailing list