MCPcopy Index your code
hub / github.com/RustPython/RustPython / push_async_callback

Method push_async_callback

Lib/contextlib.py:690–701  ·  view source on GitHub ↗

Registers an arbitrary coroutine function and arguments. Cannot suppress exceptions.

(self, callback, /, *args, **kwds)

Source from the content-addressed store, hash-verified

688 return exit # Allow use as a decorator
689
690 def push_async_callback(self, callback, /, *args, **kwds):
691 """Registers an arbitrary coroutine function and arguments.
692
693 Cannot suppress exceptions.
694 """
695 _exit_wrapper = self._create_async_cb_wrapper(callback, *args, **kwds)
696
697 # We changed the signature, so using @wraps is not appropriate, but
698 # setting __wrapped__ may still help with introspection.
699 _exit_wrapper.__wrapped__ = callback
700 self._push_exit_callback(_exit_wrapper, False)
701 return callback # Allow use as a decorator
702
703 async def aclose(self):
704 """Immediately unwind the context stack."""

Callers 2

test_async_callbackMethod · 0.80

Calls 2

_push_exit_callbackMethod · 0.80

Tested by 2

test_async_callbackMethod · 0.64