[New-bugs-announce] [issue28433] Add sorted (ordered) containers

Марк Коренберг report at bugs.python.org
Thu Oct 13 14:21:37 EDT 2016


New submission from Марк Коренберг:

I mean mutable containers that are always sorted when iterating over them.
i.e.

* SortedSet (sorted unique elements, implemented using (rb?)tree instead of hash)
* SortedList (sorted elements, the same as SortedSet, but without uniquiness constraint) - actually a (rb?)tree, not a list (i.e. not an array)
* SortedDict (sorted by key when interating) - like C++'s ordered_map


There are many implementations in the net, like:

https://bitbucket.org/bcsaller/rbtree/
http://newcenturycomputers.net/projects/rbtree.html
https://sourceforge.net/projects/pyavl/
http://www.grantjenks.com/docs/sortedcontainers/

and also in pip:

pip3 search sorted | grep -Ei '[^a-z]sorted'

I think it should be one standardized implementation of such containers in CPython.

For example, C++ has both ordered_map and unorderd_map.

P.S. Did not found if such issue was raised earlier.

----------
components: Library (Lib)
messages: 278586
nosy: mmarkk
priority: normal
severity: normal
status: open
title: Add sorted (ordered) containers
type: enhancement
versions: Python 3.7

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue28433>
_______________________________________


More information about the New-bugs-announce mailing list