Skip to main content

Hashed dict/list collections

Project description

HashedColls - hashed dict/list collections

Simple Usage

from hashedcolls import HashedDict
from hashedcolls import HashedList

d = HashedDict
l = HashedList

my = d({d({1: 1}): 1, l([1, 2, 3]): 2, (1,): 3})

How it works?

By default, dict and list Python 3 collections can not be used as a key for a dict, because they are mutable, thus are not hashable.
But both HashedDict and HashedList contain __hash__() method implemented.
How it works is that both of these classes have Hashed mixin included, so they are able to use Hashed.elements2hash() function, that basically returns __hash__() of all elements (items() in case of a dict).

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

hashedcolls-1.1.1-py3-none-any.whl (2.6 kB view details)

Uploaded Python 3

File details

Details for the file hashedcolls-1.1.1-py3-none-any.whl.

File metadata

  • Download URL: hashedcolls-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 2.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.10

File hashes

Hashes for hashedcolls-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8a0038ad158c30f18f8344aa3da7f9ce92349860fc1195d8c05063ba147a218e
MD5 2c716390c7469aabad8b728cb7648ee2
BLAKE2b-256 7948b0bc375bdbe9fe8896b950974f0dccc47c2dfa6deae66e150ff8ae3c9d71

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page