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

Replace ZoneInfo typehints in localtime module #106

Merged
merged 2 commits into from
Oct 27, 2023

Conversation

josh-lynch
Copy link
Contributor

@josh-lynch josh-lynch commented Oct 26, 2023

Previously we changed the typehints in this module to accept zoneinfo.ZoneInfo instances, however this excludes certain objects from being passed that we actually do want to support. This PR changes the typehint to datetime.tzinfo objects, which is a more permissive typehint allowing both ZoneInfo and the other objects we desire.

Replaces with the newer | operator instead.
@josh-lynch josh-lynch requested a review from a team October 26, 2023 10:37
Replaces with datetime.tzinfo which is the parent class of
ZoneInfo.
@josh-lynch josh-lynch changed the title localtime/fix typehints Replace ZoneInfo typehints in localtime module Oct 26, 2023
@jamesbeith
Copy link
Contributor

cc. @pydanny

@josh-lynch josh-lynch merged commit 0118c8c into main Oct 27, 2023
1 check passed
@josh-lynch josh-lynch deleted the localtime/fix-typehints branch October 27, 2023 06:37
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