Skip to content
Snippets Groups Projects
Commit 1772599d authored by Christopher Spinrath's avatar Christopher Spinrath
Browse files

Make Variables logable by implementing __repr__

parent bd7acd91
Branches main
No related tags found
No related merge requests found
...@@ -22,6 +22,12 @@ class Variable(ABC): ...@@ -22,6 +22,12 @@ class Variable(ABC):
def name(self): def name(self):
return self._name return self._name
def __repr__(self):
return json.dumps({
'name': self.name,
'type': str(type(self).__name__),
})
@abstractmethod @abstractmethod
def evaluate(self, variable_mapping): def evaluate(self, variable_mapping):
pass pass
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment