Skip to content

Commit

Permalink
Merge pull request #1348 from crytic/0xalpharush-patch-2
Browse files Browse the repository at this point in the history
implement eq for literal
  • Loading branch information
montyly committed Aug 16, 2022
2 parents a277925 + 6819084 commit 5b718a1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions slither/core/expressions/literal.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,8 @@ def __str__(self):
return str(convert_subdenomination(self._value, self.subdenomination))
# be sure to handle any character
return str(self._value)

def __eq__(self, other):
if not isinstance(other, Literal):
return False
return (self.value, self.subdenomination) == (other.value, other.subdenomination)

0 comments on commit 5b718a1

Please sign in to comment.