Skip to content

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

Merged
sdispater merged 2 commits intopython-pendulum:masterfrom
bryanforbes:update-for-pep-561
Mar 6, 2020
Merged

Update typing comments and add py.typed for PEP-561 compliance#320
sdispater merged 2 commits intopython-pendulum:masterfrom
bryanforbes:update-for-pep-561

Conversation

@bryanforbes
Copy link
Copy Markdown
Contributor

No description provided.

@liliserf
Copy link
Copy Markdown

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
Copy Markdown

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
Copy Markdown
Collaborator

Thanks!



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

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
Copy Markdown

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