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

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

* SortedSet (sorted unique elements, implemented using (rb?)tree instead of 
* 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:

and also in pip:

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

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

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 <>
Python-bugs-list mailing list

Reply via email to