Currently we store states and actions in regular dictionaries. These allow for mutable operations. There is a benefit in knowing that the states and actions dictionaries will never change after creation.
Some potential approaches:
- Use
types.MappingProxyType to get a read-only view of a dictionary. We would then only pass around this view.
- Use third-party library https://github.com/MagicStack/immutables