Try “blue” instead: https://pypi.org/project/blue/ It’s mostly black with some monkey patching for single quotes. (I’m on of the authors. Feedback welcome!)
There’s also “blue” which I’m the author of and looks similar: https://pypi.org/project/blue/ would love to get your help and thoughts in the issue tracker or by email.
Author here. Longish article but I wanted to make a fairly comprehensive reply to those who have doubted SortedContainers' ability to scale. If you jump down to the benchmarks section, you'll see the performance at 10,000,000,000 (ten billion) elements. I ended up paying $40 to rent a highmem instance on GCE for 1,011 minutes to run the benchmarks. For those curious, the memory high-water mark was ~128GB using PyPy. These results would be a lot more expensive to replicate with any other sorted collections library today.
Author here. I created this because the filebased cache backend that ships with Django is really broken for caches with more than 1,000 keys. The design of DiskCache is based on SQLite and the filesystem which is a pretty solid combination. Frequent cache reads are stored in shared memory-mapped files while remaining thread and process safe. That makes lookups faster than networked options like memcached and redis.
I wrote a Python module called PyPatt that implements Pythonic Pattern Matching as you'd find in functional languages. There's both a function-based and macro-based version. The macro version is deprecated but was used for a while.