py-hopscotch-dict

A replacement for dict using hopscotch hashing.


License
Other
Install
pip install py-hopscotch-dict==2.1.2

Documentation

py-hopscotch-dict

GitHub Workflow Codecov Python Versions Package Version

py-hopscotch-dict is a package that contains a replacement for the standard Python dict which implements the concepts of hopscotch hashing, as explained in the foundational paper.

Hopscotch hashing provides a number of benefits over the methods used in the standard dict implementation, most notably that insertions, deletions and lookups have an expected O(1) runtime.

py-hopscotch-dict has not been tested in a concurrent environment and thusly cannot be guaranteed to function correctly in conjunction with multi-threading, across multiple processes or in an asynchronous environment.

Usage

>>> from py_hopscotch_dict import HopscotchDict
>>> d = HopscotchDict()
>>> d["test"] = True
>>> d
HopscotchDict({'test': True})