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
merged 1 commit into from
Jul 13, 2020

Conversation

rodsenra
Copy link
Contributor

Basically a bug fix PR based on discussion for Issue #450
This PR incorporates a suggestion from @shot in
https://github.com/sdispater/pendulum/pull/320/files#diff-d79c6f58aeecd540ddd61603df9184aaR17

@rodsenra rodsenra force-pushed the fix_parse_return_typing branch 4 times, most recently from 7ce2941 to 7368f1e Compare March 20, 2020 21:04
@rodsenra rodsenra force-pushed the fix_parse_return_typing branch from 7368f1e to 13654e1 Compare March 20, 2020 21:22
@bryanforbes
Copy link
Contributor

@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?

@traviscook21
Copy link

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 python-pendulum:master Jul 13, 2020
@sdispater
Copy link
Collaborator

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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants