重构Caller类,移除泛型参数;添加函数签名复制装饰器

This commit is contained in:
2024-12-15 17:08:02 +08:00
parent af9a5e3c96
commit 0379789bec
8 changed files with 208 additions and 72 deletions

View File

@ -1,5 +1,7 @@
from typing import Any, Callable, Coroutine, TypeAlias
from typing import Any, Callable, Coroutine, TypeAlias, TypeVar
SYNC_FUNCTION_CALL_FUNC: TypeAlias = Callable[..., str]
ASYNC_FUNCTION_CALL_FUNC: TypeAlias = Callable[..., Coroutine[str, Any, str]]
FUNCTION_CALL_FUNC: TypeAlias = SYNC_FUNCTION_CALL_FUNC | ASYNC_FUNCTION_CALL_FUNC
F = TypeVar("F", bound=FUNCTION_CALL_FUNC)