-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
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
Conversation
e369bc7
to
33dd738
Compare
Even though it doesn't seem to help us cherry-pick, I would feel a bit more comfortable if I could merge this into @Yhg1s As RM for 3.12, I think you are the right person to ask — is it possible to merge this into |
33dd738
to
8139805
Compare
8139805
to
937b144
Compare
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.
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. |
Nice :-) |
This was mistakenly dropped in python#103637 Noticed when updating typeshed for Python 3.12
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]>
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.