Page MenuHomeSolus

Update python-sortedcontainers to 2.2.2

Authored by algent on Sun, Sep 6, 7:27 PM.




  • Add "small slice" optimization to SortedList.__getitem__.
  • Silence warning when testing SortedList.iloc.
  • Fix a warning regarding classifiers in
  • Change SortedDict to avoid cycles for CPython reference counting.

Signed-off-by: Algent Albrahimi <>

Test Plan
  • Update python-interlvaltree.
  • Run a few scripts using spyder3.
  • Download photos from my phone using rapid-photo-downloader.
  • Run these examples using cli:
>>> from sortedcontainers import SortedList
>>> sl = SortedList(['e', 'a', 'c', 'd', 'b'])
>>> sl
SortedList(['a', 'b', 'c', 'd', 'e'])
>>> sl *= 10_000_000
>>> sl.count('c')
>>> sl[-3:]
['e', 'e', 'e']
>>> from sortedcontainers import SortedDict
>>> sd = SortedDict({'c': 3, 'a': 1, 'b': 2})
>>> sd
SortedDict({'a': 1, 'b': 2, 'c': 3})
>>> sd.popitem(index=-1)
('c', 3)
>>> from sortedcontainers import SortedSet
>>> ss = SortedSet('abracadabra')
>>> ss
SortedSet(['a', 'b', 'c', 'd', 'r'])
>>> ss.bisect_left('c')

Diff Detail

R3673 python-sortedcontainers
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

algent created this revision.Sun, Sep 6, 7:27 PM
algent requested review of this revision.Sun, Sep 6, 7:27 PM
algent edited the test plan for this revision. (Show Details)Sun, Sep 6, 7:33 PM
JoshStrobl accepted this revision.Wed, Sep 9, 2:04 PM
JoshStrobl added a subscriber: JoshStrobl.

LGTM, thanks!

This revision is now accepted and ready to land.Wed, Sep 9, 2:04 PM
This revision was automatically updated to reflect the committed changes.