[Python-Dev] namedtuple implementation grumble

Nick Coghlan ncoghlan at gmail.com
Sun Jun 8 01:35:58 CEST 2014


On 8 Jun 2014 05:44, "Glenn Linderman" <v+python at g.nevcal.com> wrote:
>
> I wonder if the dynamically constructed classes approach could lead to
the same space and time efficiencies... seems like I recall there being a
discussion of efficiency, I think primarily space efficiency, as a
justification for the present implementation. namedtuple predates of the
improvements in metaclasses, also, which may be a justification for the
present implementation.

As far as I am aware, there's nothing magical in the classes namedtuple
creates that would require a custom metaclass - it's just that what it does
would likely be even harder to read if written out explicitly rather than
letting the compiler & eval loop deal with it.

However, we've drifted off topic for python-dev at this point. If anyone
wanted to experiment with alternative implementations, python-ideas would
be the place to discuss that.

Cheers,
Nick.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20140608/7fde3b51/attachment.html>


More information about the Python-Dev mailing list