{ } Raw JSON

bundles / jupyter_core latest / jupyter_core / utils / ensure_async

function

jupyter_core.utils:ensure_async

source: /jupyter_core/utils/__init__.py:204

Signature

async def ensure_async(obj: Awaitable[T] | T) → T

Summary

Convert a non-awaitable object to a coroutine if needed, and await it if it was not already awaited.

Extended Summary

This function is meant to be called on the result of calling a function, when that function could either be asynchronous or not.

Aliases

  • jupyter_core.utils.ensure_async