4 ms·
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 u
by the_mitsuhiko 13y ago
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.
- mjschultz 13y agoThe --setup code (creating the namedtuple and dict) is only executed once. The timed portion is simply the field accesses.