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>
Sun, 14 Jan 2024 12:27:05 +0000 (15:27 +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