1414T = TypeVar ("T" )
1515F = TypeVar ("F" , bound = Callable )
1616
17- Decorator = Callable [[F ], F ]
18-
1917
2018class 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