[Christopher Barker email@example.com]
Earlier in the thread, we were pointed to multiple implementations.
Is this particular one clearly the “best”[*]?
If so, then sure.
[*] best meaning “most appropriate for the stdlib”. A couple folks have already pointed to the quality of the code. But my understanding is that different algorithms are more or less appropriate for different use cases. So is this one fairly “universal”?
As noted earlier, SortedContainers is downloaded from PyPI hundreds of thousands of times every day, and that's been so for a long time.. Best I can tell, no similar package is in the same universe as that.
The author identified over a dozen potential competitors here, but most didn't look like serious projects to him. He ran extensive timing tests against the rest, reported there too. HIs package usually wins, and is at worst competitive. It usually wins on memory burden too.
Some of these things are people intrigued by "a data structure" they read about and implement for fun and self-education. That sometimes shines through in data-structure-specific APIs. While the SortedContainers extensive docs explain how things are implemented (if you look in the right spots for that), the API is remarkably agnostic (& useful)). For example, this is a method of SortedList:
irange(minimum=None, maximum=None, inclusive=(True, True), reverse=False)
which returns an iterator over a contiguous sorted range of values (neither, either, or both of whose endpoints may be included, depending on what you pass for `inclusive` This "makes sense" regardless of how the structure may be implemented. Of course SortedSet and SortedDict support `irange()` too.