[Python-ideas] a new namedtuple

Steven D'Aprano steve at pearwood.info
Thu Jul 20 12:32:16 EDT 2017


On Tue, Jul 18, 2017 at 06:06:00PM -0300, Joao S. O. Bueno wrote:
> In the other thread, I had mentioned my "extradict" implementation - it
> does have quite a few differences as it did not try to match namedtuple
> API, but it works nicely for all common use cases - these are the timeit
> timings:
[...]
> (env) [gwidion at caylus ]$ python3 -m timeit --setup "from extradict import
> namedtuple"     "K = namedtuple('K', 'a b c')"
> 10000 loops, best of 3: 20 usec per loop
> 
> (env) [gwidion at caylus ]$ python3 -m timeit --setup "from extradict import
> fastnamedtuple as namedtuple"     "K = namedtuple('K', 'a b c')"
> 10000 loops, best of 3: 21 usec per loop

Are you concerned that "fastnamedtuple" is no faster, and possibly 
slower, than "namedtuple"?


-- 
Steve


More information about the Python-ideas mailing list