-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
gh-117398: Use Per-Interpreter State for the _datetime Static Types #119929
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 39 commits into
python:main
from
ericsnowcurrently:datetime-static-types
Jun 3, 2024
Merged
Changes from 38 commits
Commits
Show all changes
39 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 1e3005d
_PyStaticType_Dealloc() -> _PyStaticType_FiniBuiltin()
ericsnowcurrently ab38857
Add _PyStaticType_InitForExtension() and _PyStaticType_FiniForExtensi…
ericsnowcurrently 0fb6bb3
Use them for the _datetime module.
ericsnowcurrently 9e4eee6
Mark the module as safe for subinterpreters.
ericsnowcurrently 293fd2e
Add a NEWS entry.
ericsnowcurrently f0db33a
Ignore the new global vars in the C analyzer tool.
ericsnowcurrently 326d957
Fix a smelly name.
ericsnowcurrently 04eb383
Fix a comment.
ericsnowcurrently 0e8c3b1
Fix callback_for_interp_exit().
ericsnowcurrently 67812dc
Pass around "initial" instead of using _Py_IsMainInterpreter().
ericsnowcurrently e5ab548
Finalize the static types if PyUnstable_AtExit() fails.
ericsnowcurrently 4f21a28
Make sure we're using the right index for extension static types.
ericsnowcurrently 0fd9fae
Use PyErr_WriteUnraisable().
ericsnowcurrently 3905ae8
Clean up clear_current_module() a little.
ericsnowcurrently 7216e24
Update a TODO comment.
ericsnowcurrently 349f910
Merge branch 'main' into datetime-static-types
ericsnowcurrently e057548
Update Misc/NEWS.d/next/Library/2024-06-01-16-58-43.gh-issue-117398.k…
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
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
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
2 changes: 2 additions & 0 deletions
2
Misc/NEWS.d/next/Library/2024-06-01-16-58-43.gh-issue-117398.kR0RW7.rst
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
The ``_datetime`` module (C implementation for ``datetime``) now supports | ||
being imported in multiple interpreters. |
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.