Add a dict-compatible API for ResourceDictField and make it immutable.
Review Request #12252 — Created April 22, 2022 and submitted
ResourceDictFieldbehaves sort of like a standard
dict, but it
wasn't one. It lacked a lot of the functions and behavior that a
would support. It wasn't mutable, and didn't pretend to be, but the lack
of standard mutable dictionary operations made it a bit confusing.
This change updates this class to inherit from
it a standard
dictinterface. All mutable operations are now available
on the class, but will raise a helpful message explaining that the
dictionary cannot be modified and how to do an update to the resource,
which should be useful to people working with the API.
Subclasses will build upon this to offer better immutable guidance (for
Unit tests pass on all supported versions of Python.