Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #466.
Changes
datetime.timezoneobjects using their native offset-based equality.utcoffset(None), so different offsets are distinguishable in sets and unordered comparisons, while equal offsets with different display names remain equal.This keeps timezone objects in change reports for in-memory Delta replay. Custom
tzinfoandZoneInfobehavior is outside this change.Validation
git diff --check: passed.dev; no new diagnostics.Known limitation for review
The timezone hash follows the existing scalar hashing convention, which shares a namespace with user strings. Consequently,
DeepDiff([timezone.utc], ['timezone:0:00:00'], ignore_order=True)returns an empty diff with this change, whereas the baseline reports a type change. Equivalent collisions already exist for other scalars (for example,1and'int:1'). This patch does not redesign hash domain separation; maintainer guidance on the intended scope is welcome.Existing timezone serialization requirements are unchanged: JSON output needs an appropriate
default_mapping, and persisted Delta loading may requiresafe_to_import={'datetime.timezone'}.