Skip to content

Commit

Permalink
Merge pull request #158 from Maarten-vd-Sande/master
Browse files Browse the repository at this point in the history
implement Sequence.__eq__
  • Loading branch information
mdshw5 authored Jan 16, 2020
2 parents a045dba + 33fdb64 commit f8db508
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pyfaidx/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,13 @@ def __len__(self):
"""
return len(self.seq)

def __eq__(self, other):
"""
>>> Sequence('chr1', 'ACT') == 'ACT'
True
"""
return str(self) == str(other)

@property
def fancy_name(self):
""" Return the fancy name for the sequence, including start, end, and complementation.
Expand Down

0 comments on commit f8db508

Please sign in to comment.