@@ -96,8 +96,8 @@ def group(
96
96
* ,
97
97
help : Optional [str ] = None ,
98
98
cls : Optional [Type [OptionGroup ]] = None ,
99
- ** attrs ,
100
- ) -> Decorator :
99
+ ** attrs : Any ,
100
+ ) -> Decorator [ F ] :
101
101
"""The decorator creates a new group and collects its options
102
102
103
103
Creates the option group and registers all grouped options
@@ -115,7 +115,7 @@ def group(
115
115
msg = "'cls' must be a subclass of 'OptionGroup' class."
116
116
raise TypeError (msg )
117
117
118
- def decorator (func ) :
118
+ def decorator (func : F ) -> F :
119
119
callback , params = get_callback_and_params (func )
120
120
121
121
if callback not in self ._decorating_state :
@@ -153,7 +153,7 @@ def decorator(func):
153
153
154
154
return decorator
155
155
156
- def option (self , * param_decls , ** attrs ) -> Decorator :
156
+ def option (self , * param_decls : str , ** attrs : Any ) -> Decorator [ F ] :
157
157
"""The decorator adds a new option to the group
158
158
159
159
The decorator is lazy. It adds option decls and attrs.
@@ -163,7 +163,7 @@ def option(self, *param_decls, **attrs) -> Decorator:
163
163
:param attrs: additional option attributes and parameters
164
164
"""
165
165
166
- def decorator (func ) :
166
+ def decorator (func : F ) -> F :
167
167
callback , params = get_callback_and_params (func )
168
168
169
169
option_stack = self ._decorating_state [callback ]
@@ -177,7 +177,7 @@ def decorator(func):
177
177
178
178
return decorator
179
179
180
- def help_option (self , * param_decls , ** attrs ) -> Decorator :
180
+ def help_option (self , * param_decls : str , ** attrs : Any ) -> Decorator [ F ] :
181
181
"""This decorator adds a help option to the group, which prints
182
182
the command's help text and exits.
183
183
"""
0 commit comments