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

This commit is contained in:
David Euresti
2018-07-13 19:23:47 -07:00
committed by Jelle Zijlstra
parent dc9f9db77f
commit 99f25d0cd3
2 changed files with 4 additions and 4 deletions

View File

@@ -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[[Callable], Command]:
...
def group(self, *args, **kwargs) -> Callable[[_F], _F]:
def group(self, *args, **kwargs) -> Callable[[Callable], Group]:
...

View File

@@ -41,7 +41,7 @@ def command(
short_help: Optional[str] = ...,
options_metavar: str = ...,
add_help_option: bool = ...,
) -> Callable[[_F], _F]:
) -> Callable[[Callable], Command]:
...
@@ -66,7 +66,7 @@ def group(
add_help_option: bool = ...,
# User-defined
**kwargs: Any,
) -> Callable[[_F], _F]:
) -> Callable[[Callable], Group]:
...