summaryrefslogtreecommitdiff
path: root/tools/checker/common/immutables.py
diff options
context:
space:
mode:
Diffstat (limited to 'tools/checker/common/immutables.py')
-rw-r--r--tools/checker/common/immutables.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/tools/checker/common/immutables.py b/tools/checker/common/immutables.py
index e016867c23..3a29ce3c0d 100644
--- a/tools/checker/common/immutables.py
+++ b/tools/checker/common/immutables.py
@@ -12,6 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+
class ImmutableDict(dict):
def __setitem__(self, key, value):
raise RuntimeError("Cannot modify ImmutableDict")
@@ -19,7 +20,7 @@ class ImmutableDict(dict):
def __delitem__(self, key):
raise RuntimeError("Cannot modify ImmutableDict")
- def copyWith(self, key, value):
- newDict = ImmutableDict(self)
- dict.__setitem__(newDict, key, value)
- return newDict
+ def copy_with(self, key, value):
+ new_dict = ImmutableDict(self)
+ dict.__setitem__(new_dict, key, value)
+ return new_dict