cantok
cantok copied to clipboard
wait() method could distinguish between awaitable and not-awaitable with inspect.isawaitable()
Perhaps i missing some deeper meaning/use-case but couldn't you just do something like this:
async def await_me_maybe(callback):
result = callback()
if inspect.isawaitable(result):
return await result
return result
instead of the whole class WaitCoroutineWrapper and its usage?