$ python2.7 -m timeit 'd={}' 10000000 loops, best of 3: 0.0331 usec per loop $ python2.7 -m timeit 'd=dict()' 1000000 loops, best of 3: 0.19 usec per loop
为什么用一个而不是另一个?
python performance dictionary timing
dictionary ×1
performance ×1
python ×1
timing ×1