Commit 3c6c98f4 authored by hscham's avatar hscham Committed by Chromium LUCI CQ

Make NamedValue hashable

For Python3 compatibility.
hash function added in crrev.com/c/2277687 for Field requires hash
function for EnumValue (self.default).

BUG=941669

Change-Id: I787bca64a05d379088a6e2846f03b76e258e0701
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2584728Reviewed-by: default avatarDarin Fisher <darin@chromium.org>
Reviewed-by: default avatarOksana Zhuravlova <oksamyt@chromium.org>
Commit-Queue: Grace Cham <hscham@chromium.org>
Cr-Commit-Position: refs/heads/master@{#837885}
parent 018e6784
......@@ -310,6 +310,9 @@ class NamedValue(object):
and (self.parent_kind, self.mojom_name) == (rhs.parent_kind,
rhs.mojom_name))
def __hash__(self):
return hash((self.parent_kind, self.mojom_name))
class BuiltinValue(object):
def __init__(self, value):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment