Преглед изворни кода

Implement __str__, __repr__ for tree_ir.VariableName

jonathanvdc пре 9 година
родитељ
комит
06569ed74d
1 измењених фајлова са 6 додато и 0 уклоњено
  1. 6 0
      kernel/modelverse_jit/tree_ir.py

+ 6 - 0
kernel/modelverse_jit/tree_ir.py

@@ -802,6 +802,12 @@ class VariableName(object):
            instruction if it is not None."""
            instruction if it is not None."""
         return self.name
         return self.name
 
 
+    def __str__(self):
+        return self.name
+
+    def __repr__(self):
+        return 'VariableName(%r)' % self.name
+
 class VariableInstruction(Instruction):
 class VariableInstruction(Instruction):
     """A base class for instructions that access variables."""
     """A base class for instructions that access variables."""
     def __init__(self, name):
     def __init__(self, name):