You are viewing an older version (9.11.0). Go to latest (9.13.0)
{ } Raw JSON

bundles / IPython 9.11.0 / IPython / core / magics / basic / AsyncMagics / autoawait

function

IPython.core.magics.basic:AsyncMagics.autoawait

source: /IPython/core/magics/basic.py :676

Signature

def   autoawait ( self parameter_s )

Summary

Allow to change the status of the autoawait option.

Extended Summary

This allow you to set a specific asynchronous code runner.

If no value is passed, print the currently used asynchronous integration and whether it is activated.

It can take a number of value evaluated in the following order:

  • False/false/off deactivate autoawait integration

  • True/true/on activate autoawait integration using configured default loop

  • asyncio/curio/trio activate autoawait integration and use integration with said library.

  • sync turn on the pseudo-sync integration (mostly used for IPython.embed() which does not run IPython with a real eventloop and deactivate running asynchronous code. Turning on Asynchronous code with the pseudo sync loop is undefined behavior and may lead IPython to crash.

If the passed parameter does not match any of the above and is a python identifier, get said object from user namespace and set it as the runner, and activate autoawait.

If the object is a fully qualified object name, attempt to import it and set it as the runner, and activate autoawait.

The exact behavior of autoawait is experimental and subject to change across version of IPython and Python.

Aliases

  • IPython.core.magics.AsyncMagics.autoawait