Skip to content

Commit

Permalink
made accessing of tail and head from edge more explicit
Browse files Browse the repository at this point in the history
  • Loading branch information
eileen-kuehn committed Jul 26, 2018
1 parent d61c2a2 commit 9e133b0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion graphi/edge.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,11 @@ def __class__(self):
return slice

def __getitem__(self, index):
return [self.start, self.stop][index]
if index == 0:
return self.start
elif index == 1:
return self.stop
raise ValueError

def __iter__(self):
yield self.start
Expand Down

0 comments on commit 9e133b0

Please sign in to comment.