Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update __eq__ methods on various objects #134

Merged
merged 3 commits into from
Feb 6, 2014
Merged

Update __eq__ methods on various objects #134

merged 3 commits into from
Feb 6, 2014

Conversation

bow
Copy link

@bow 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
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
Update __eq__ methods on various objects
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants