From: Dmitry Selyutin Date: Sun, 14 Jan 2024 12:17:18 +0000 (+0300) Subject: oppc/ast: hash node by id X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=627338b9c45ca99a844d263e656f08b4683caacf;p=openpower-isa.git oppc/ast: hash node by id --- diff --git a/src/openpower/oppc/pc_ast.py b/src/openpower/oppc/pc_ast.py index 93df556a..2626b358 100644 --- a/src/openpower/oppc/pc_ast.py +++ b/src/openpower/oppc/pc_ast.py @@ -10,6 +10,9 @@ class Node(metaclass=NodeMeta): def __repr__(self): return f"{hex(id(self))}@{self.__class__.__name__}()" + def __hash__(self): + return id(self) + def __eq__(self, other): if not isinstance(other, self.__class__): return NotImplemented