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

Update typing comments and add py.typed for PEP-561 compliance #320

Merged
merged 2 commits into from
Mar 6, 2020

Conversation

bryanforbes
Copy link
Contributor

No description provided.

@liliserf
Copy link

liliserf commented Mar 1, 2019

This looks great! Any estimate on when it might make it in? I'm stubbing what I need right now but it would great to have the full type annotations.

@txomon
Copy link

txomon commented Jan 6, 2020

Hello people, is there any chance we can get this forward?

@sdispater sdispater merged commit d1b430f into python-pendulum:master Mar 6, 2020
@sdispater
Copy link
Collaborator

Thanks!

@@ -13,7 +14,7 @@
from .tz import UTC


def parse(text, **options):
def parse(text, **options): # type: (str, **typing.Any) -> str

Choose a reason for hiding this comment

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

Is the return type really str? I am not familiar with the pendulum code base, but this looks suspicious to me.

Copy link

Choose a reason for hiding this comment

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

I believe the correct return type is typing.Union[pendulum.Date, pendulum.Time, pendulum.Duration].

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.

6 participants