Python equivalent to java.util.SortedSet?

前端 未结 7 1815
灰色年华
灰色年华 2021-02-05 06:59

Does anybody know if Python has an equivalent to Java\'s SortedSet interface?

Heres what I\'m looking for: lets say I have an object of type foo, and I know

7条回答
  •  说谎
    说谎 (楼主)
    2021-02-05 07:21

    Take a look at BTrees. It look like you need one of them. As far as I understood you need structure that will support relatively cheap insertion of element into storage structure and cheap sorting operation (or even lack of it). BTrees offers that.

    I've experience with ZODB.BTrees, and they scale to thousands and millions of elements.

提交回复
热议问题