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
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
8000
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