Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
the_mitsuhiko
· 12y ago · 0 comments
Yep. Because the dictionary literal gets created via opcodes in the interpreter loop whereas the named tuple pays the price of calling a function and setting up an interpreter frame.
Comments
[–]
mjschultz
12y ago
The --setup code (creating the namedtuple and dict) is only executed once.
The timed portion is simply the field accesses.