Skip to content

Commit

Permalink
feat: improve patch type hint
Browse files Browse the repository at this point in the history
  • Loading branch information
st1020 committed Sep 21, 2023
1 parent 61399c1 commit 846538c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions dongtai_conf/patch/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,14 @@ def wrapper(*args: Any, **kwargs: Any):


def patch(patch_func: Callable[..., Any], patch_id: int = 0):
@overload
def wrapper(func: Callable[[Unpack[tuple[T]]], T]):
...

@overload
def wrapper(func: Callable[[Unpack[Ts]], tuple[Unpack[Ts]]]):
...

def wrapper(func: Callable[..., Any]):
to_patch_func = getattr(patch_func, "to_patch_func", None)
if to_patch_func is None:
Expand Down

0 comments on commit 846538c

Please sign in to comment.