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.
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
Fix TzInfo equality check based on offset #1197
Fix TzInfo equality check based on offset #1197
Changes from 8 commits
5bf8899
bf929db
51f2f5d
616e48f
604c33a
9e42571
f0c0922
88408f4
f099f3a
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
I think we should add tests to confirm that comparisons with
zoneinfo.ZoneInfo("Europe/London")
or similar don't succeed.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.
Test added for
zoneinfo.ZoneInfo
would check whether it return false. As,NotImplemented
would not throw error. there would be identity check eventually as__eq__
is not implemented for right-side and left-side. Would this be right way of doing this? Other option would be to throw NotImplementedError.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.
I think by returning
NotImplemented
then equality will returnFalse
and ordering operators will raise aTypeError
. I see you added an equality test, maybe add a test that ordering throwsTypeError
and then we're good here?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.
Got it. Thank you so much @davidhewitt .