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

Click: Make group and command decorators return the correct types #2331

Merged
merged 2 commits into from
Jul 14, 2018

Conversation

euresti
Copy link
Contributor

@euresti euresti commented Jul 13, 2018

These decorators actually replace the function with an object. I checked the others and they are correct.

@@ -293,10 +293,10 @@ class Group(MultiCommand):
def add_command(self, cmd: Command, name: Optional[str] = ...):
...

def command(self, *args, **kwargs) -> Callable[[_F], _F]:
def command(self, *args, **kwargs) -> Callable[[_F], Command]:
Copy link
Member

Choose a reason for hiding this comment

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

We shouldn't be using the _F typevar in this case.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good call. Fixed!

@JelleZijlstra JelleZijlstra merged commit 99f25d0 into python:master Jul 14, 2018
yedpodtrzitko pushed a commit to yedpodtrzitko/typeshed that referenced this pull request Jan 23, 2019
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.

2 participants