Typed maybe_coroutine

This commit is contained in:
Sengolda 2021-10-28 01:17:47 +05:30 committed by GitHub
parent c2184fe244
commit cbc0e92e5d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -507,7 +507,7 @@ def _parse_ratelimit_header(request: Any, *, use_clock: bool = False) -> float:
return float(reset_after)
async def maybe_coroutine(f, *args, **kwargs):
async def maybe_coroutine(f: Callable[..., Any], *args: Any, **kwargs: Any) -> Callable[..., Any]:
value = f(*args, **kwargs)
if _isawaitable(value):
return await value