From 627338b9c45ca99a844d263e656f08b4683caacf Mon Sep 17 00:00:00 2001 From: Dmitry Selyutin Date: Sun, 14 Jan 2024 15:17:18 +0300 Subject: [PATCH] oppc/ast: hash node by id --- src/openpower/oppc/pc_ast.py | 3 +++ 1 file changed, 3 insertions(+) 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 -- 2.30.2