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 hashes)
Built Distribution
Close
Hashes for mutablekeysdict-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1f87e579d2246f6e6f4b67e6a1bf862dd4d25508af8ffb7ea4f33318bad7f30a |
|
MD5 | fb8e3cf785f1d2348d88a764647b86de |
|
BLAKE2b-256 | 77c4f9d81ce84a0cbc5322ddbe19fdea6a464ad876bfd05a91e7904c461d0e8f |