Skip to content

Commit 02890eb

Browse files
committed
Add caching to timezones()
1 parent e533943 commit 02890eb

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/pendulum/tz/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from __future__ import annotations
22

3+
from functools import cache
34
from zoneinfo import available_timezones
45

56
from pendulum.tz.local_timezone import get_local_timezone
@@ -17,6 +18,7 @@
1718
_tz_cache: dict[int, FixedTimezone] = {}
1819

1920

21+
@cache
2022
def timezones() -> set[str]:
2123
return available_timezones()
2224

0 commit comments

Comments
 (0)