MCPcopy
hub / github.com/nonebot/nonebot2 / is_async_gen_callable

Function is_async_gen_callable

nonebot/utils.py:240–245  ·  view source on GitHub ↗

检查 call 是否是一个异步生成器函数

(call: Callable[..., Any])

Source from the content-addressed store, hash-verified

238
239
240def is_async_gen_callable(call: Callable[..., Any]) -> bool:
241 """检查 call 是否是一个异步生成器函数"""
242 if inspect.isasyncgenfunction(call):
243 return True
244 func_ = getattr(call, "__call__", None)
245 return inspect.isasyncgenfunction(func_)
246
247
248def run_sync(call: Callable[P, R]) -> Callable[P, Coroutine[None, None, R]]:

Callers 2

_solveMethod · 0.90

Calls

no outgoing calls

Tested by 1