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
immutable_dict = AdaendraImmutableDict({})
immutable_dict = AdaendraImmutableDict({"hello": "world"})
immutable_dict["hello"]
immutable_dict_copy = immutable_dict.copy()
immutable_dict = AdaendraImmutableDict.fromkeys(["a", "b"], "1")
Documentation
Credits
This project is based on Marco Sulla's project: frozen-dict.