8000 gh-99138: Isolate _zoneinfo by erlend-aasland · Pull Request #99218 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-99138: Isolate _zoneinfo #99218

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 30 commits into from
Feb 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
a5d7a79
Convert zone info type to heap type and add it to global state
Nov 2, 2020
45ad0b6
Remove unneeded tp_base placeholder
erlend-aasland Nov 7, 2022
accb561
Add io_open to global state
erlend-aasland Nov 7, 2022
61530f0
Add _tzpath_find_tzfile to global state
erlend-aasland Nov 7, 2022
8639a03
Add _common_mod to global state
erlend-aasland Nov 7, 2022
e728631
Add TIMEDELTA_CACHE to global state
erlend-aasland Nov 7, 2022
96241c9
Add ZONEINFO_WEAK_CACHE to global state
erlend-aasland Nov 7, 2022
39a0b7c
Move ZONEINFO_STRONG_CACHE to global state
erlend-aasland Nov 7, 2022
4749890
Move ZONEINFO_STRONG_CACHE_MAX_SIZE to constants and make it const
erlend-aasland Nov 7, 2022
5e71905
Add NO_TTINFO to global state
erlend-aasland Nov 7, 2022
4c31528
Add module arg to zoneinfo_get_state()
erlend-aasland Nov 7, 2022
0f1f1ea
Global state to module state
erlend-aasland Nov 7, 2022
573aec1
Style nit
erlend-aasland Nov 7, 2022
773a836
Address review: add comment above cache pointers
erlend-aasland Nov 7, 2022
6e69e93
Sync with main
erlend-aasland Nov 15, 2022
3e4f429
Merge branch 'main' into isolate-zoneinfo
erlend-aasland Jan 2, 2023
d4101af
Add NEWS
erlend-aasland Jan 2, 2023
1ef23da
Sync with main
erlend-aasland Jan 23, 2023
23cbc43
Simplify cache init
erlend-aasland Jan 23, 2023
ae5c549
Purge zoneinfo from c analyzer todo
erlend-aasland Jan 23, 2023
8adb727
Sync with main
erlend-aasland Feb 1, 2023
7c8836e
Sync with main
erlend-aasland Feb 3, 2023
6d5216e
Address reviews
erlend-aasland Feb 3, 2023
b7944dd
Pull in main
erlend-aasland Feb 12, 2023
71392bb
Pull in main
erlend-aasland Feb 15, 2023
244c537
Address review: remove warning about process-wide global state
erlend-aasland Feb 15, 2023
c32d46d
Pull in main
erlend-aasland Feb 15, 2023
75f519b
Revert "Address review: remove warning about process-wide global state"
erlend-aasland Feb 15, 2023
3b460ad
Address review: document that initialize_caches() is not idempotent
erlend-aasland Feb 15, 2023
a9dbc4d
Address review: reword cache warning only slightly
erlend-aasland Feb 15, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Doc/library/zoneinfo.rst
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ The following class methods are also available:
.. warning::

Invoking this function may change the semantics of datetimes using
``ZoneInfo`` in surprising ways; this modifies process-wide global state
``ZoneInfo`` in surprising ways; this modifies module state
and thus may have wide-ranging effects. Only use it if you know that you
need to.

Expand Down
4 changes: 1 addition & 3 deletions Lib/test/test_zoneinfo/test_zoneinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -1797,12 +1797,10 @@ def test_cache_location(self):
self.assertTrue(hasattr(py_zoneinfo.ZoneInfo, "_weak_cache"))

def test_gc_tracked(self):
# The pure Python version is tracked by the GC but (for now) the C
# version is not.
import gc

self.assertTrue(gc.is_tracked(py_zoneinfo.ZoneInfo))
self.assertFalse(gc.is_tracked(c_zoneinfo.ZoneInfo))
self.assertTrue(gc.is_tracked(c_zoneinfo.ZoneInfo))


@dataclasses.dataclass(frozen=True)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Apply :pep:`687` to :mod:`zoneinfo`. Patch by Erlend E. Aasland.
Loading
0