An immutable dict
Project description
Python Immutable Dict
This library contains the ImmutableDict, a Python dictionary which can't be updated.
How to use it
- Install it from pip
pip install adaendra-immutable-dict
- Import the AdaendreImmutableDict
from adaendra_immutable_dict.AdaendraImmutableDict import AdaendraImmutableDict
- Use it like in the following examples.
Examples
from adaendra_immutable_dict.AdaendraImmutableDict import AdaendraImmutableDict
# Empty Immutable Dict
immutable_dict = AdaendraImmutableDict({})
# Non empty Immutable Dict
immutable_dict = AdaendraImmutableDict({"hello": "world"})
# Get a value
immutable_dict["hello"]
#> world
# Copy dict
immutable_dict_copy = immutable_dict.copy()
# Create an immutable dict from "fromkeys" method
immutable_dict = AdaendraImmutableDict.fromkeys(["a", "b"], "1")
Documentation
Credits
This project is based on Marco Sulla's project: frozen-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 Distribution
Built Distribution
Close
Hashes for adaendra_immutable_dict-1.0.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | bff88d05fe9bbcade7b3ffbb96114eda3ce82dbeb6824a68aafcf16ccabfc6d9 |
|
MD5 | 2da95f123eee31ddeeae12a69cc74a3a |
|
BLAKE2b-256 | 6a7b1d1320b924197e5a417ba292b112e44d427fd688f612b8de8444c2e213e8 |
Close
Hashes for adaendra_immutable_dict-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a77b6f38884b0e3f475d681ae7497e4e7bf28674c76cddf730e3ffa2e1ea59ef |
|
MD5 | f4dc54037b5d551c0a3bd14bb9b9440b |
|
BLAKE2b-256 | 3da5f57c97930c32aa2dd72aa5db39efe4cb38bb1d560ab0a7ccf454d7e33021 |