Skip to content

Commit

Permalink
Fix the typing annotation for the return of parse() (#452)
Browse files Browse the repository at this point in the history
  • Loading branch information
rodsenra authored Jul 13, 2020
1 parent 8af1e2e commit 1b1784f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pendulum/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@

import pendulum

from .date import Date
from .parsing import _Interval
from .parsing import parse as base_parse
from .time import Duration
from .time import Time
from .tz import UTC


Expand All @@ -16,7 +19,9 @@
CDuration = None


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

Expand Down

0 comments on commit 1b1784f

Please sign in to comment.