Skip to content

Commit acf8b3d

Browse files
committed
remove type hints from _re.py
1 parent 7e91152 commit acf8b3d

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/tomli/_re.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
from datetime import date, datetime, time, timedelta, timezone, tzinfo
88
from functools import lru_cache
99
import re
10-
from typing import Any
1110

1211
from ._types import ParseFloat
1312

@@ -49,7 +48,7 @@
4948
)
5049

5150

52-
def match_to_datetime(match: re.Match) -> datetime | date:
51+
def match_to_datetime(match):
5352
"""Convert a `RE_DATETIME` match to `datetime.datetime` or `datetime.date`.
5453
5554
Raises ValueError if the match does not correspond to a valid date
@@ -85,7 +84,7 @@ def match_to_datetime(match: re.Match) -> datetime | date:
8584

8685

8786
@lru_cache(maxsize=None)
88-
def cached_tz(hour_str: str, minute_str: str, sign_str: str) -> timezone:
87+
def cached_tz(hour_str, minute_str, sign_str):
8988
sign = 1 if sign_str == "+" else -1
9089
return timezone(
9190
timedelta(
@@ -95,13 +94,13 @@ def cached_tz(hour_str: str, minute_str: str, sign_str: str) -> timezone:
9594
)
9695

9796

98-
def match_to_localtime(match: re.Match) -> time:
97+
def match_to_localtime(match):
9998
hour_str, minute_str, sec_str, micros_str = match.groups()
10099
micros = int(micros_str.ljust(6, "0")) if micros_str else 0
101100
return time(int(hour_str), int(minute_str), int(sec_str), micros)
102101

103102

104-
def match_to_number(match: re.Match, parse_float: ParseFloat) -> Any:
103+
def match_to_number(match, parse_float):
105104
if match.group("floatpart"):
106105
return parse_float(match.group())
107106
return int(match.group(), 0)

0 commit comments

Comments
 (0)