Skip to content

GH-84976: Create Lib/_pydatetime to optimize import datetime when C implementation is available #103637

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

Merged
merged 2 commits into from
May 3, 2023

Conversation

pganssle
Copy link
Member

@pganssle pganssle commented Apr 19, 2023

From the discussion on stack overflow, #84976 and #99090, no one can find a way to do this that allows clean cherry-picks, but also no one can explain why it's not possible, but at this point it's not worth delaying any more. We rarely need to backport things into datetime.py, and in those rare cases we can do it manually. If it suddenly becomes very common, we can maybe special-case it in Miss Islington.

@pganssle
Copy link
Member Author

CC @ezio-melotti

@pganssle
Copy link
Member Author

Even though it doesn't seem to help us cherry-pick, I would feel a bit more comfortable if I could merge this into main as-is rather than doing a squash merge.

@Yhg1s As RM for 3.12, I think you are the right person to ask — is it possible to merge this into main without squash merge? I think it would be 3 or 4 commits instead of 1.

pganssle added 2 commits May 2, 2023 12:29
This breaks the tests, but we are keeping it as a separate commit so
that the move operation and editing of the moved files are separate, for
a cleaner history.
Without the change to the reprs, pure-python classes would have a repr
of `datetime._pydatetime.time`, etc.
@pganssle pganssle force-pushed the move_pydatetime branch from 937b144 to 012ffde Compare May 2, 2023 16:29
@Yhg1s Yhg1s merged commit 0a5cd98 into python:main May 3, 2023
@Yhg1s
Copy link
Member

Yhg1s commented May 3, 2023

FYI, I've merged the two commits with rebase (not squashing), so they are two separate commits in the main branch, which hopefully makes future backports easier.

@vstinner
Copy link
Member

vstinner commented May 3, 2023

Nice :-)

hauntsaninja added a commit to hauntsaninja/cpython that referenced this pull request May 25, 2023
This was mistakenly dropped in python#103637

Noticed when updating typeshed for Python 3.12
pganssle pushed a commit that referenced this pull request May 25, 2023
gh-84796: Add back UTC to datetime.__all__

This was mistakenly dropped in #103637

Noticed when updating typeshed for Python 3.12
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jun 23, 2023
pythongh-84796: Add back UTC to datetime.__all__

This was mistakenly dropped in pythonGH-103637

Noticed when updating typeshed for Python 3.12
(cherry picked from commit 076b620)

Co-authored-by: Shantanu <[email protected]>
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.

6 participants