On Tue, 9 Nov 2021 at 16:01, Bob Fang <boyufang@bytedance.com> wrote:
This is a modest proposal to consider having sorted containers (http://www.grantjenks.com/docs/sortedcontainers/) in standard library. I know that usually adding stuff to standard library requires some strong arguments, so I will try my best to give my reasons here:

As of 3.7. dicts are sorted[1], but I'm unsure if the order can be overridden. Indeed:

>>> Boys = {'Tim': 18,'Charlie':12,'Robert':25}

Girls = {'Tiffany':22}  


>>> print(cmp(Girls, Boys))

Traceback (most recent call last):

  File "<stdin>", line 1, in <module>

NameError: name 'cmp' is not defined

>>> Girls.__gt__(Boys)

NotImplemented


-- H

--
If you wish to request my time, please do so using bit.ly/hd1AppointmentRequest.
Si vous voudrais faire connnaisance, allez a bit.ly/hd1AppointmentRequest.

Sent from my mobile device
Envoye de mon portable