INADA Naoki added the comment:
I think external cache system introduces more complexity and startup overhead
than AC.
I think functools is the only "very common" module using namedtuple, because
`functools.wraps()` is used to create decorator functions.
But if general solution for all namedtuple is necessary to make agreement,
I think C implemented namedtuple may be better.
structseq is faster than namedtuple, not only when building type, but also
using instance.
$ ./python -m perf timeit -s 'import sys; vi = sys.version_info' -- 'vi.major,
vi.minor, vi.micro'
.....................
Median +- std dev: 130 ns +- 2 ns
$ ./python -m perf timeit -s 'from collections import namedtuple;
VersionInfo=namedtuple("VersionInfo", "major minor micro releaselevel serial");
vi=VersionInfo(3, 7, 0, "alpha", 0)' -- 'vi.major, vi.minor, vi.micro'
.....................
Median +- std dev: 212 ns +- 4 ns
----------
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue28638>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com