Pure Python mutable keys dictionary class.
Project description
MutableKeysDict
A pure python dictionary class that allows the keys to be mutated.
Description
Use MutableKeysDict if you need a dict that can mutate the keys and still work. MutableKeysDict keys still need to be hashable. Use dictanykey if you need a dict that can use unhashable keys.
Getting Started
Dependencies
- Python>=3.6
Installing
- pip install mutablekeysdict
Example Code
from mutablekeysdict import MutableKeysDict
class HashableList(list):
def __hash__(self):
return hash(tuple(self))
h = HashableList([1, 2, 3])
d = MutableKeysDict({h: 6})
h.append(4)
d[h] -> 6
Authors
Contributors names and contact info
Odos Matthews: odosmatthews@gmail.com
License
This project is licensed under the MIT License - see the LICENSE.md file for details
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 Distribution
mutablekeysdict-0.0.2.tar.gz
(2.5 kB
view details)
Built Distribution
File details
Details for the file mutablekeysdict-0.0.2.tar.gz
.
File metadata
- Download URL: mutablekeysdict-0.0.2.tar.gz
- Upload date:
- Size: 2.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bcb6b3b8f1c9006e1d27869202b136a744cf572ab4279e1529db946cc82a4917 |
|
MD5 | ee9223adaf5b009fd1cd25c39f6cb2a1 |
|
BLAKE2b-256 | 20f6e503a857e263d66d8732f2eabc4f1a60c07bf78637b92a6add88cd670916 |
File details
Details for the file mutablekeysdict-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: mutablekeysdict-0.0.2-py3-none-any.whl
- Upload date:
- Size: 2.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1f87e579d2246f6e6f4b67e6a1bf862dd4d25508af8ffb7ea4f33318bad7f30a |
|
MD5 | fb8e3cf785f1d2348d88a764647b86de |
|
BLAKE2b-256 | 77c4f9d81ce84a0cbc5322ddbe19fdea6a464ad876bfd05a91e7904c461d0e8f |