This package implements a treap-based dictionary-like interface for Python. This is the pure Python version; the other is a Cython version which is in the pyx_treap pypi package. The pure Python version may actually be a bit faster at about 100,000 values, but the Cython version is vastly faster for larger collections. The nest.py module is a quick demo of what you might use a treap for. It keeps the n lowest (or n highest) values from a potentially large series of values. Courtesy of Zaar Hai, on pickling the cython version:: >>> import treap >>> import cPickle >>> t = treap.treap() >>> t[1] = 1 >>> cPickle.dumps(t, protocol=2)