-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
gh-117398: Add datetime Module State #119810
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
ericsnowcurrently
merged 24 commits into
python:main
from
ericsnowcurrently:datetime-module-state-2
Jun 3, 2024
Merged
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
8463ae8
Use the static types directly.
ericsnowcurrently ead0083
Use the UTC singleton directly.
ericsnowcurrently 4c52d5d
Add module state.
ericsnowcurrently 6b291c8
Clear the module state when destroying the module.
ericsnowcurrently 69c7e1f
Create PyDateTime_IsoCalendarDateType in init_state().
ericsnowcurrently 36dbeea
Track the "current" module in the internal per-interpreter dict.
ericsnowcurrently d0c0b2d
Copy the "current" module state, if available.
ericsnowcurrently 0599dd6
Make state usage explicit.
ericsnowcurrently 1f1f6fc
Reduce churn.
ericsnowcurrently d44d6e9
Drop _datetime_global_state.
ericsnowcurrently a309474
Drop datetime_state.initialized.
ericsnowcurrently ede4415
Fix refleaks.
ericsnowcurrently 5a8b1aa
Clear the "current" module when finalizing the module.
ericsnowcurrently 3de1cd3
Use a weakref when tracking the "current" module.
ericsnowcurrently 62b3d5e
Fix clear_current_module().
ericsnowcurrently 5c25927
Give each module its own heap types.
ericsnowcurrently da24674
Consolidate into init_state().
ericsnowcurrently f8420ea
Use _Py_ID() for INTERP_KEY.
ericsnowcurrently 2a2c0b1
Handle PyWeakref_GetRef() returning None.
ericsnowcurrently c519e3c
Fix refleak.
ericsnowcurrently 05acc56
Make sure the module exists in static type methods.
ericsnowcurrently 07e3b65
Don't bother making the module temporary.
ericsnowcurrently dc4b458
Add a comment about the macros.
ericsnowcurrently 3c55035
Simplify GET_CURRENT_STATE().
ericsnowcurrently File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Make sure the module exists in static type methods.
- Loading branch information
commit 05acc56c6bdd017fc02a2fb586597f66249353a4
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why NULL?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's there so the macro can transparently declare the
current_mod
local var. However, that made more sense in an earlier iteration of the PR. I'll simplify this for clarity.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed