[Python-ideas] namedtuple with ordereddict

Greg Ewing greg.ewing at canterbury.ac.nz
Tue Jul 18 18:33:22 EDT 2017

Jim J. Jewett wrote:
> is there any reason not to simply define it as a view on a dict, or at
> least as a limited proxy to one?

Some valuable characteristics of namedtuples as they are now:

* Instances are very lightweight
* Access by index is fast
* Can be used as a dict key

All of those would be lost if namedtuple became a dict view.


More information about the Python-ideas mailing list