Update __eq__ methods on various objects #134

Merged
merged 3 commits into from Feb 6, 2014

Conversation

Projects
None yet
2 participants

bow commented Dec 4, 2013

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 a TypeError, these objects now always return False when compared against None (because nothing equals None except for None 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.

jamescasbon added a commit that referenced this pull request Feb 6, 2014

Merge pull request #134 from bow/patch_equalities
Update __eq__ methods on various objects

@jamescasbon jamescasbon merged commit a5318ba into jamescasbon:master Feb 6, 2014

gotgenes pushed a commit to gotgenes/PyVCF that referenced this pull request May 13, 2014

Merge pull request #134 from bow/patch_equalities
Update __eq__ methods on various objects
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment