Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wait() method could distinguish between awaitable and not-awaitable with inspect.isawaitable() #33

Open
kbaikov opened this issue Apr 25, 2024 · 0 comments

Comments

@kbaikov
Copy link

kbaikov commented Apr 25, 2024

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant