Skip to content

Commit

Permalink
added check for equality on edge
Browse files Browse the repository at this point in the history
  • Loading branch information
eileen-kuehn committed Jul 26, 2018
1 parent 83b22e8 commit d12edb8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions graphi/edge.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ def __iter__(self):
def __str__(self):
return '[%s:%s]' % (self.start, self.stop)

def __eq__(self, other):
if not isinstance(self, type(other)):
return NotImplemented
return self.start == other.start and self.stop == other.stop

def __repr__(self):
return '%s[%r:%r]' % (type(self).__name__, self.start, self.stop)

Expand Down

0 comments on commit d12edb8

Please sign in to comment.