【发布时间】:2011-02-14 06:12:29
【问题描述】:
$ 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