- Creates a class FrozenDict that behaves like dict, but all mutable methods are removed. - Compatible with both Python2 and Python3. - Like a tuple, FrozenDict is hashable if and only if all its items are hashable.
PythonMIT
FrozenDict
Behaves in most ways like a regular dictionary, except that it's immutable, TRULY immutable.
Most implementations of FrozenDict simply subclass dict, or wrap a thin object around one.
This implemtation does the wrapping at the C level, making it impossible to change from Python.
Use it like a regular dictionary, such as in this example: