Skip to content

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

Merged
pganssle merged 11 commits into
dateutil:masterfrom
pganssle:tzutc_update
Apr 25, 2019
Merged

Use tz.UTC in favor of tz.tzutc() where possible.#910
pganssle merged 11 commits into
dateutil:masterfrom
pganssle:tzutc_update

Conversation

@pganssle

@pganssle pganssle commented Apr 23, 2019

Copy link
Copy Markdown
Member

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

pganssle added 11 commits April 23, 2019 13:54
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.

1 participant