MCPcopy Create free account
hub / github.com/ipython/ipython / _async_exec

Method _async_exec

IPython/core/interactiveshell.py:3361–3374  ·  view source on GitHub ↗

Evaluate an asynchronous code object using a code runner Fake asynchronous execution of code_object in a namespace via a proxy namespace. Returns coroutine object, which can be executed via async loop runner WARNING: The semantics of `async_exec` are quite differe

(self, code_obj: types.CodeType, user_ns: dict)

Source from the content-addressed store, hash-verified

3359 return False
3360
3361 def _async_exec(self, code_obj: types.CodeType, user_ns: dict):
3362 """
3363 Evaluate an asynchronous code object using a code runner
3364
3365 Fake asynchronous execution of code_object in a namespace via a proxy namespace.
3366
3367 Returns coroutine object, which can be executed via async loop runner
3368
3369 WARNING: The semantics of `async_exec` are quite different from `exec`,
3370 in particular you can only pass a single namespace. It also return a
3371 handle to the value of the last things returned by code_object.
3372 """
3373
3374 return eval(code_obj, user_ns)
3375
3376 async def run_code(self, code_obj, result=None, *, async_=False):
3377 """Execute a code object.

Callers 1

run_codeMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected