[issue28638] Creating namedtuple is too slow to be used in common stdlib (e.g. functools)

Serhiy Storchaka report at bugs.python.org
Tue Nov 8 06:17:32 EST 2016


Serhiy Storchaka added the comment:

Using namedtuple is not new in 3.6, thus this is not a regression that can be fixed at beta stage.

Inlining the source of a named tuple class looks ugly solution. It would be better to write the source in separate file and import it. Makefile can have a rule for recreating this source file if collections.py is changed.

More general solution would be to make namedtuple() using cached precompiled class and update the cache if it doesn't match namedtuple arguments.

Yet one solution is to make namedtuple() not using compiling, but return patched local class. But Raymond is against this.

----------
assignee:  -> rhettinger
versions:  -Python 3.6

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue28638>
_______________________________________


More information about the Python-bugs-list mailing list