-
Notifications
You must be signed in to change notification settings - Fork 215
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
make Schema.__eq__ deterministic #316
make Schema.__eq__ deterministic #316
Conversation
This fills in missing test coverage to ensure the __eq__ method does not return True in some potentially unexpected cases (these tests would fail before be867c5).
Previously only the __eq__ method was implemented, which could lead to surprising behavior e.g.: Schema('foo') == Schema('foo') # True Schema('foo') != Schema('foo') # True This adds the __ne__ method so that these operators are complementary as one might expect.
Update: after adding some more tests for this, I noticed that the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @dtao
Thanks for the prompt response. This PR looks good to me. Please squash your commits and let's get it merged.
Thanks.
@tusharmakkar08 you should be able to Squash and merge the branch through GitHub: |
@alecthomas Didn't know it existed 😅 |
This adds a test to highlight the issue raised in #315 and proposes a solution: instead of comparing
str(self.schema)
withstr(other)
, just compareschema
attributes directly.