oppc/ast: hash node by id
authorDmitry Selyutin <ghostmansd@gmail.com>
Sun, 14 Jan 2024 12:17:18 +0000 (15:17 +0300)
committerDmitry Selyutin <ghostmansd@gmail.com>
Tue, 16 Jan 2024 19:10:07 +0000 (22:10 +0300)
src/openpower/oppc/pc_ast.py

index 93df556a8d6107438a0b5d2d4e94777d9af5b7bb..2626b3583032ec50ad8336143728bd60b80dc5da 100644 (file)
@@ -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