🏷️ fix typing error

This commit is contained in:
yanyongyu 2022-02-11 11:25:31 +08:00
parent c0af89a6ad
commit 943de58826
No known key found for this signature in database
GPG Key ID: 796D8A7FB73396EB

View File

@ -22,6 +22,7 @@ from typing import (
Callable, Callable,
Optional, Optional,
Awaitable, Awaitable,
Coroutine,
AsyncGenerator, AsyncGenerator,
ContextManager, ContextManager,
) )
@ -99,7 +100,7 @@ def is_async_gen_callable(call: Callable[..., Any]) -> bool:
return inspect.isasyncgenfunction(func_) return inspect.isasyncgenfunction(func_)
def run_sync(call: Callable[P, R]) -> Callable[P, Awaitable[R]]: def run_sync(call: Callable[P, R]) -> Callable[P, Coroutine[None, None, R]]:
"""一个用于包装 sync function 为 async function 的装饰器 """一个用于包装 sync function 为 async function 的装饰器
参数: 参数: