MCPcopy Index your code
hub / github.com/python/cpython / cached_tz

Function cached_tz

Lib/tomllib/_re.py:99–106  ·  view source on GitHub ↗
(hour_str: str, minute_str: str, sign_str: str)

Source from the content-addressed store, hash-verified

97# 24 (hours) * 60 (minutes) * 2 (offset direction) = 2880.
98@lru_cache(maxsize=None)
99def cached_tz(hour_str: str, minute_str: str, sign_str: str) -> timezone:
100 sign = 1 if sign_str == "+" else -1
101 return timezone(
102 timedelta(
103 hours=sign * int(hour_str),
104 minutes=sign * int(minute_str),
105 )
106 )
107
108
109def match_to_localtime(match: re.Match[str]) -> time:

Callers 1

match_to_datetimeFunction · 0.85

Calls 2

timezoneClass · 0.90
timedeltaClass · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…