Skip to content

Commit

Permalink
Fix Match object equality
Browse files Browse the repository at this point in the history
  • Loading branch information
Toilal committed Oct 24, 2015
1 parent d86f648 commit 3b972cd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions rebulk/match.py
Original file line number Diff line number Diff line change
Expand Up @@ -634,12 +634,14 @@ def __hash__(self):

def __eq__(self, other):
if isinstance(other, Match):
return self.span == other.span and self.value == other.value and self.parent == other.parent
return self.span == other.span and self.value == other.value and self.name == other.name and \
self.parent == other.parent
return NotImplemented

def __ne__(self, other):
if isinstance(other, Match):
return self.span != other.span or self.value != other.value or self.parent != other.parent
return self.span != other.span or self.value != other.value or self.name != other.name or \
self.parent != other.parent
return NotImplemented

def __lt__(self, other):
Expand Down

0 comments on commit 3b972cd

Please sign in to comment.