frozendict

An immutable dictionary implementation for Python

pipmacoslinuxwindows
Try with needOr install directly
Source

About

A simple immutable dictionary

Commands

frozendict

Examples

Create an immutable dictionary from a regular dict$ python3 -c "from frozendict import frozendict; d = frozendict({'a': 1, 'b': 2}); print(d)"
Use frozendict as a dictionary key (hashable)$ python3 -c "from frozendict import frozendict; d = frozendict({'x': 10}); keys = {d: 'value'}; print(keys)"
Verify immutability by attempting modification$ python3 -c "from frozendict import frozendict; d = frozendict({'a': 1}); d['a'] = 2" 2>&1 | head -1