Skip to content

Commit 423a90c

Browse files
committed
fixup the types of decorators to return the same callable
1 parent bb329f7 commit 423a90c

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed
Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
from collections.abc import Callable
2-
from typing import Any
2+
from typing import TypeVar
3+
from typing_extensions import ParamSpec
34

4-
def check_resource(resource_name: str): ...
5-
def minimum_version(version: str): ...
6-
def update_headers(f: Callable[..., Any]): ...
5+
_P = ParamSpec("_P")
6+
_R = TypeVar("_R")
7+
8+
def check_resource(resource_name: str) -> Callable[[Callable[_P, _R]], Callable[_P, _R]]: ...
9+
def minimum_version(version: str) -> Callable[[Callable[_P, _R]], Callable[_P, _R]]: ...
10+
def update_headers(f: Callable[_P, _R]) -> Callable[_P, _R]: ...

0 commit comments

Comments
 (0)