Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the typing annotation for the return of parse() #452

merged 1 commit into from Jul 13, 2020


Copy link

@rodsenra rodsenra commented Mar 20, 2020

Basically a bug fix PR based on discussion for Issue #450
This PR incorporates a suggestion from @shot in

@rodsenra rodsenra force-pushed the fix_parse_return_typing branch 4 times, most recently from 7ce2941 to 7368f1e Compare Mar 20, 2020
@rodsenra rodsenra force-pushed the fix_parse_return_typing branch from 7368f1e to 13654e1 Compare Mar 20, 2020
Copy link

bryanforbes commented Apr 7, 2020

@sdispater this looks good

def parse(text, **options): # type: (str, **typing.Any) -> str
def parse(
text, **options
): # type: (str, **typing.Any) -> typing.Union[Date, Time, Duration]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DateTime also possible, right?

Copy link

traviscook21 commented Jun 5, 2020

I have code like this all of over some repos I'm working on

dt: pendulum.DateTime = pendulum.parse("2019-12-31")  # type: ignore

I wish it could be as simple as

dt = pendulum.parse("2019-12-31")

Anything I can do to help get this merged / released?

@sdispater sdispater merged commit 1b1784f into sdispater:master Jul 13, 2020
20 checks passed
Copy link

sdispater commented Jul 13, 2020

Thanks for your contribution!

@sdispater sdispater mentioned this pull request Jul 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

Successfully merging this pull request may close these issues.

None yet

4 participants