Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-91928: Adddatetime.UTC alias fordatetime.timezone.utc#91973

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
miss-islington merged 8 commits intopython:mainfromKab1r:feat-datetime-utc-alias
May 3, 2022

Conversation

@Kab1r
Copy link
Contributor

@Kab1rKab1r commentedApr 27, 2022
edited by miss-islington
Loading

fixes#91928

UTC is now module attribute aliased todatetime.timezone.utc.
You can now do the following:

fromdatetimeimportUTC

Automerge-Triggered-By: GH:pganssle

@ghost
Copy link

ghost commentedApr 27, 2022
edited by ghost
Loading

All commit authors signed the Contributor License Agreement.
CLA signed

@bedevere-bot
Copy link

Every change to Pythonrequires a NEWS entry.

Please, add it using theblurb_it Web app or theblurb command-line tool.

Copy link
Member

@pgansslepganssle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

This looks great, thanks!

In addition to my other comments, two other things:

  1. As I believe you are a first-time contributor, you should probably add your name toMisc/ACKS.
  2. Maybe add a very simple test toTestModule, like this:
deftest_utc_alias(self):self.assertIs(UTC,timezone.utc)

Thanks for your contribution!

@bedevere-bot
Copy link

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phraseI have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@Kab1r
Copy link
ContributorAuthor

I have made the requested changes; please review again

@bedevere-bot
Copy link

Thanks for making the requested changes!

@pganssle: please review the changes made to this pull request.

Copy link
Member

@pgansslepganssle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Can you add this test?

Maybe add a very simple test to TestModule, like this:

deftest_utc_alias(self):self.assertIs(UTC,timezone.utc)

Kab1r reacted with thumbs up emoji
@bedevere-bot
Copy link

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phraseI have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@Kab1r
Copy link
ContributorAuthor

I had to move the definition ofdatetime.UTC to the end so that modifications todatetime.timezone.utc doesn't make it a different object.

@Kab1r
Copy link
ContributorAuthor

I have made the requested changes; please review again

@bedevere-bot
Copy link

Thanks for making the requested changes!

@pganssle: please review the changes made to this pull request.

Kab1rand others added4 commitsMay 3, 2022 14:02
1. Add UTC definition into C implementation as well (just for   consistency, there's no particular reason not to simply assign the   alias in the Python code later).2. Move `..versionadded` tag into the right place
@pgansslepganssleforce-pushed thefeat-datetime-utc-alias branch fromc097669 to9542f54CompareMay 3, 2022 20:02
@pganssle
Copy link
Member

Thanks@Kab1r!

natoscott added a commit to natoscott/pcp that referenced this pull requestMay 8, 2025
Resolves an issue Ken reported running tests in the QA farm,which is due to use of an interface from more-recent-python:python/cpython#91973
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@pgansslepgansslepganssle approved these changes

@abalkinabalkinAwaiting requested review from abalkinabalkin is a code owner

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Adddatetime.UTC alias fordatetime.timezone.utc

4 participants

@Kab1r@bedevere-bot@pganssle@miss-islington

[8]ページ先頭

©2009-2025 Movatter.jp