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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8a0038ad158c30f18f8344aa3da7f9ce92349860fc1195d8c05063ba147a218e
|
|
| MD5 |
2c716390c7469aabad8b728cb7648ee2
|
|
| BLAKE2b-256 |
7948b0bc375bdbe9fe8896b950974f0dccc47c2dfa6deae66e150ff8ae3c9d71
|