擅长:python、mysql、java
<p>Raymond Hettinger的这一个是将出现在Python2.7中的collections.OrderedDict的替换项:<a href="http://pypi.python.org/pypi/ordereddict" rel="noreferrer">http://pypi.python.org/pypi/ordereddict</a></p>
<p>collections文档的dev版本表示,它相当于Python 2.7中的版本,因此很可能会顺利过渡到Python附带的版本。</p>
<p>我把它放在PyPI中,这样您就可以用<code>easy_install ordereddict</code>安装它,并像这样使用它:</p>
<pre><code>from ordereddict import OrderedDict
d = OrderedDict([("one", 1), ("two", 2)])
</code></pre>