Skip to main content

A replacement for dict using hopscotch hashing

Project description

py-hopscotch-dict

GitHub Workflow Codecov Python Versions Package Version License

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})

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

py-hopscotch-dict-2.0.1.tar.gz (20.6 kB view hashes)

Uploaded source

Built Distribution

py_hopscotch_dict-2.0.1-py3-none-any.whl (15.0 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page