diff --git a/varcode/collection.py b/varcode/collection.py index 47b622c..854ec32 100644 --- a/varcode/collection.py +++ b/varcode/collection.py @@ -89,6 +89,8 @@ def __getitem__(self, idx): return self.elements[idx] def __eq__(self, other): + if self is other: + return True return ( self.__class__ == other.__class__ and len(self) == len(other) and diff --git a/varcode/effect_collection.py b/varcode/effect_collection.py index b413926..b1f3ad7 100644 --- a/varcode/effect_collection.py +++ b/varcode/effect_collection.py @@ -178,7 +178,6 @@ def detailed_string(self): lines.append(" Highest Priority Effect: %s" % best) return "\n".join(lines) - @memoize def top_priority_effect(self): """Highest priority MutationEffect of all genes/transcripts overlapped by this variant. If this variant doesn't overlap anything, then this diff --git a/varcode/variant.py b/varcode/variant.py index 8b7f65f..d87f980 100644 --- a/varcode/variant.py +++ b/varcode/variant.py @@ -219,6 +219,8 @@ def fields(self): self.ensembl.release) def __eq__(self, other): + if self is other: + return True return ( self.contig == other.contig and self.start == other.start and