Skip to content

Commit 2acefa8

Browse files
authored
Merge pull request #73 from adamtheturtle/fix-mypy-and-pyright
Fix use of mypy while maintaining pyright compatibility
2 parents 56105d2 + 4501cb4 commit 2acefa8

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/click_option_group/_decorators.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
T = TypeVar("T")
1515
F = TypeVar("F", bound=Callable)
1616

17-
Decorator = Callable[[F], F]
18-
1917

2018
class OptionStackItem(NamedTuple):
2119
param_decls: Tuple[str, ...]
@@ -97,7 +95,7 @@ def group(
9795
help: Optional[str] = None,
9896
cls: Optional[Type[OptionGroup]] = None,
9997
**attrs: Any,
100-
) -> Decorator[F]:
98+
) -> Callable[[F], F]:
10199
"""The decorator creates a new group and collects its options
102100
103101
Creates the option group and registers all grouped options
@@ -153,7 +151,7 @@ def decorator(func: F) -> F:
153151

154152
return decorator
155153

156-
def option(self, *param_decls: str, **attrs: Any) -> Decorator[F]:
154+
def option(self, *param_decls: str, **attrs: Any) -> Callable[[F], F]:
157155
"""The decorator adds a new option to the group
158156
159157
The decorator is lazy. It adds option decls and attrs.
@@ -177,7 +175,7 @@ def decorator(func: F) -> F:
177175

178176
return decorator
179177

180-
def help_option(self, *param_decls: str, **attrs: Any) -> Decorator[F]:
178+
def help_option(self, *param_decls: str, **attrs: Any) -> Callable[[F], F]:
181179
"""This decorator adds a help option to the group, which prints
182180
the command's help text and exits.
183181
"""

0 commit comments

Comments
 (0)