Update __eq__ methods on various objects #134
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request started with a mention in #132.
Basically, these commits update equality testing to
None
on various PyVCF objects to be more sensible. Instead of raising aTypeError
, these objects now always returnFalse
when compared againstNone
(because nothing equalsNone
except forNone
itself) or other objects of different types.Behavior for other comparisons (e.g. less than, greater than) is still left unchanged because
TypeError
is an appropriate response in those cases.Related to this, I also updated the test in #132. I think it's more sensible this way since we can clearly see with different ways of saying whether two records are equal, we get different number of overlapping and distinct records (the updated tests are only possible after this
__eq__
behavior change, so I'm putting it here).Tests for this new behavior have also been added (albeit not that much, only for
_Record
and_Call
). I think this should be ok for now.