@@ -50,7 +50,9 @@ def new_func(*args: P.args, **kwargs: P.kwargs) -> R:
5050
5151def make_pass_decorator (
5252 object_type : type [T ], ensure : bool = False
53- ) -> t .Callable [[t .Callable [te .Concatenate [T , P ], R ]], t .Callable [P , R ]]:
53+ ) -> t .Callable [
54+ [t .Callable [te .Concatenate [T , P ], R ]], t .Callable [P , t .Coroutine [t .Any , t .Any , R ]]
55+ ]:
5456 """Given an object type this creates a decorator that will work
5557 similar to :func:`pass_obj` but instead of passing the object of the
5658 current context, it will find the innermost context of type
@@ -76,7 +78,7 @@ def new_func(ctx, *args, **kwargs):
7678 def decorator (
7779 f : t .Callable [te .Concatenate [T , P ], R ],
7880 ) -> t .Callable [P , t .Coroutine [t .Any , t .Any , R ]]:
79- def new_func (* args : P .args , ** kwargs : P .kwargs ) -> R :
81+ def new_func (* args : P .args , ** kwargs : P .kwargs ) -> t . Coroutine [ t . Any , t . Any , R ] :
8082 ctx = get_current_context ()
8183
8284 obj : T | None
@@ -101,7 +103,9 @@ def new_func(*args: P.args, **kwargs: P.kwargs) -> R:
101103
102104def pass_meta_key (
103105 key : str , * , doc_description : str | None = None
104- ) -> t .Callable [[t .Callable [te .Concatenate [T , P ], R ]], t .Callable [P , R ]]:
106+ ) -> t .Callable [
107+ [t .Callable [te .Concatenate [T , P ], R ]], t .Callable [P , t .Coroutine [t .Any , t .Any , R ]]
108+ ]:
105109 """Create a decorator that passes a key from
106110 :attr:`click.Context.meta` as the first argument to the decorated
107111 function.
0 commit comments