Add a dict-compatible API for ResourceDictField and make it immutable.

Review Request #12252 — Created April 22, 2022 and submitted

chipx86
RBTools
release-3.x
12251
rbtools

ResourceDictField behaves sort of like a standard dict, but it
wasn't one. It lacked a lot of the functions and behavior that a dict
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 MutableMapping, giving
it a standard dict interface. 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
the extra_data support).

Unit tests pass on all supported versions of Python.

Summary
Add a dict-compatible API for ResourceDictField and make it immutable.
david
  1. Ship It!
  2. 
      
chipx86
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-3.x (77e5ba8)
Loading...