Skip to content

Commit

Permalink
Fix AST repr after error in previous commit
Browse files Browse the repository at this point in the history
  • Loading branch information
pimvenderbosch committed Nov 12, 2024
1 parent e2e9782 commit 612139a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions qadence2_ir/irast.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,8 +291,9 @@ def __eq__(self, other: object) -> bool:
return self._args == other._args and self._attrs == other._attrs

def __repr__(self) -> str:
# args
result = f"{self._tag}('{self._head}', "
result += ", ".join(map(str, self._args))
# attributes
result += ", ".join([f"{key}={repr(val)}" for key, val in self._attrs.items()])
if len(self._attrs) > 0:
result += ", "
result += ", ".join([f"{key}={repr(val)}" for key, val in self._attrs.items()])
return result + ")"

0 comments on commit 612139a

Please sign in to comment.