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

Function _parse_transition_time

Lib/zoneinfo/_zoneinfo.py:731–750  ·  view source on GitHub ↗
(time_str)

Source from the content-addressed store, hash-verified

729
730
731def _parse_transition_time(time_str):
732 match = re.fullmatch(
733 r"(?P<sign>[+-])?(?P<h>\d{1,3})(:(?P<m>\d{2})(:(?P<s>\d{2}))?)?",
734 time_str,
735 re.ASCII
736 )
737 if match is None:
738 raise ValueError(f"Invalid time: {time_str}")
739
740 h, m, s = (int(v or 0) for v in match.group("h", "m", "s"))
741
742 if h > 167:
743 raise ValueError(
744 f"Hour must be in [0, 167]: {time_str}"
745 )
746
747 if match.group("sign") == "-":
748 h, m, s = -h, -m, -s
749
750 return h, m, s
751
752
753def _parse_tz_delta(tz_delta):

Callers 1

_parse_dst_start_endFunction · 0.85

Calls 1

groupMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…