Python 2.6 TreeMap / SortedDictionary? [英] Python 2.6 TreeMap/SortedDictionary?

查看:154
本文介绍了Python 2.6 TreeMap / SortedDictionary?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Python 2.6中是否有内置的排序字典实现,或者是哈希表唯一的类型?



澄清:




  • 我正在询问排序的字典, 订购字典!


解决方案

我认为这里的答案是否定的。 b

有一个Treemap,但它不在python标准库中。



http://pypi.python.org/pypi/treemap/



我想那些不喜欢我的答案的人可能认为这是错误的,由于最近的更新。请注意这是为Python 2.6,而不是2.7或Python 3



请添加正确的答案,如果你仍然认为这是错误或无益,或至少给出一个原因你认为这是一个坏的答案。


Is there a built-in sorted dictionary implementation in Python 2.6, or are hashtables the only kind?

Clarifications:

  • I'm asking about sorted dictionarys, not ordered dictionaries!

解决方案

I think the answer here is no.

There is a Treemap but it isn't in the python standard library.

http://pypi.python.org/pypi/treemap/

I think to those who don't like my answer, may think it's wrong due to a recent update. Please note this is for Python 2.6, not 2.7 or Python 3

Please add the correct answer if you still think it's wrong, or unhelpful, or at least give a reason why you think it's a bad answer.

这篇关于Python 2.6 TreeMap / SortedDictionary?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆