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

Use tz.UTC in favor of tz.tzutc() where possible. #910

Merged
merged 11 commits into from Apr 25, 2019

Conversation

pganssle
Copy link
Member

@pganssle pganssle commented Apr 23, 2019

Summary of changes

In version 2.7.0, we added the tz.UTC object as a convenience accessor for the tzutc singleton. This PR goes updates other modules and tests that were using tzutc() to use tz.UTC, except where it doesn't make sense to do so.

Pull Request Checklist

  • Changes have tests
  • Authors have been added to AUTHORS.md
  • News fragment added in changelog.d. See CONTRIBUTING.md for details

To allow the UTC object to be accessible from the functions in
`dateutil.tz.tz` such as `gettz` and datetime_exists, it is necessary to
define the UTC constant here and import it into `dateutil.tz`. This is a
very minor performance improvement, avoiding a call to the `tzutc()`
constructor.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant