This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author methane
Recipients methane, ncoghlan, rhettinger, serhiy.storchaka, xiang.zhang
Date 2016-11-08.12:16:08
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1478607368.52.0.435721278319.issue28638@psf.upfronthosting.co.za>
In-reply-to
Content
> What is the main culprit, importing the collections module or compiling a named tuple?

In this time, later.
But collections module takes 1+ ms to import too.
I'll try to optimize it.

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

Make sense.

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

What "precompiled class" means? pyc file? or source string to be
executed?

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

I'll search the discussion.
I think anther solution is reimplement namedtuple by C.
As far as I remember, attrs [1] does it.

[1] https://pypi.python.org/pypi/attrs
History
Date User Action Args
2016-11-08 12:16:08methanesetrecipients: + methane, rhettinger, ncoghlan, serhiy.storchaka, xiang.zhang
2016-11-08 12:16:08methanesetmessageid: <1478607368.52.0.435721278319.issue28638@psf.upfronthosting.co.za>
2016-11-08 12:16:08methanelinkissue28638 messages
2016-11-08 12:16:08methanecreate