return inspect.iscoroutinefunction(call)
if inspect.isclass(call):
return False
- call = getattr(call, "__call__", None)
- return inspect.iscoroutinefunction(call)
+ dunder_call = getattr(call, "__call__", None)
+ return inspect.iscoroutinefunction(dunder_call)
def is_async_gen_callable(call: Callable[..., Any]) -> bool:
if inspect.isasyncgenfunction(call):
return True
- call = getattr(call, "__call__", None)
- return inspect.isasyncgenfunction(call)
+ dunder_call = getattr(call, "__call__", None)
+ return inspect.isasyncgenfunction(dunder_call)
def is_gen_callable(call: Callable[..., Any]) -> bool:
if inspect.isgeneratorfunction(call):
return True
- call = getattr(call, "__call__", None)
- return inspect.isgeneratorfunction(call)
+ dunder_call = getattr(call, "__call__", None)
+ return inspect.isgeneratorfunction(dunder_call)
async def solve_generator(
if is_coroutine:
value, errors_ = field.validate(response_content, {}, loc=("response",))
else:
- value, errors_ = await run_in_threadpool( # type: ignore[misc]
+ value, errors_ = await run_in_threadpool(
field.validate, response_content, {}, loc=("response",)
)
if isinstance(errors_, ErrorWrapper):