diff options
Diffstat (limited to 'morphlib/morphology.py')
-rw-r--r-- | morphlib/morphology.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/morphlib/morphology.py b/morphlib/morphology.py index 2b8c0551..734c4e3d 100644 --- a/morphlib/morphology.py +++ b/morphlib/morphology.py @@ -108,6 +108,13 @@ class Morphology(object): def test_stories(self): return self._dict.get('test-stories', []) + def __eq__(self, other): + return (self.filename == other.filename and + self.treeish == other.treeish) + + def __hash__(self): + return hash((self.filename, self.treeish)) + def __str__(self): # pragma: no cover return '%s|%s|%s' % (self.treeish.original_repo, self.treeish.ref, |