Skip to content

Commit

Permalink
Merge pull request #1841 from st1020/feat/improve-patch-type-hint
Browse files Browse the repository at this point in the history
feat: improve patch type hint
  • Loading branch information
Bidaya0 authored Sep 22, 2023
2 parents 61399c1 + 846538c commit 6fc7aa6
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 6fc7aa6

Please sign in to comment.