-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
Add datetime.UTC
alias for datetime.timezone.utc
#91928
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
Comments
I tracked down the decision between One counter-example to the " |
Definitely no objections from me. 🙂 |
) ### fixes #91928 `UTC` is now module attribute aliased to `datetime.timezone.utc`. You can now do the following: ```python from datetime import UTC ```
Re-opening because this needs a What's new entry, but I selfishly didn't want to induce a merge conflict with #92177, so I'll add a What's New entry after that one gets merged. |
…-92567) I merged this without a What's New entry to avoid merge conflicts, so here's the follow-up adding the entry. @Kab1r do you mind reviewing? Closes pythonGH-91928 Automerge-Triggered-By: GH:pganssle (cherry picked from commit a0a825c) Co-authored-by: Paul Ganssle <[email protected]>
I merged this without a What's New entry to avoid merge conflicts, so here's the follow-up adding the entry. @Kab1r do you mind reviewing? Closes GH-91928 Automerge-Triggered-By: GH:pganssle (cherry picked from commit a0a825c) Co-authored-by: Paul Ganssle <[email protected]>
Feature or enhancement
Right now, the UTC singleton is only available as a class-level attribute on
datetime.timezone
, but I think a lot of people would probably like to be able to do this:Since
datetime.timezone
is a class, not a module, right now it is necessary for each person to define their ownUTC
alias (if they want such a thing) in two lines:This isn't a huge deal, but I think it would be pretty unambiguous what it refers to and might be a nice quality of life improvement.
CC: @abalkin
The text was updated successfully, but these errors were encountered: