Welcome to immutabledict’s documentation!¶
This site covers immutabledict’s API documentation for version 4.2.1. For more information about immutabledict, see the Github repository.
Usage¶
The immutabledict
class can be used as a drop-in replacement for dict
.
For replacing an collections.OrderedDict
, you can use an ImmutableOrderedDict
. The API is the same as immutabledict
, but it will use an collections.OrderedDict
under the hood.
from immutabledict import immutabledict
my_item = immutabledict({"a": "value", "b": "other_value"})
print(my_item["a"]) # Print "value"
Some additional methods are provided, see the API reference.