Skip to content

Commit 7ce2941

Browse files
committed
Fix the typing annotation for the return of parse()
1 parent c99f242 commit 7ce2941

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pendulum/parser.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,11 @@
55

66
import pendulum
77

8+
from .date import Date
89
from .parsing import _Interval
910
from .parsing import parse as base_parse
11+
from .time import Duration
12+
from .time import Time
1013
from .tz import UTC
1114

1215

@@ -16,7 +19,7 @@
1619
CDuration = None
1720

1821

19-
def parse(text, **options): # type: (str, **typing.Any) -> str
22+
def parse(text, **options): # type: (str, **typing.Any) -> typing.Union[Date, Time, Duration]
2023
# Use the mock now value if it exists
2124
options["now"] = options.get("now", pendulum.get_test_now())
2225

0 commit comments

Comments
 (0)