MCPcopy Index your code
hub / github.com/python/cpython / push_async_callback

Method push_async_callback

Lib/contextlib.py:679–690  ·  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

677 return exit # Allow use as a decorator
678
679 def push_async_callback(self, callback, /, *args, **kwds):
680 """Registers an arbitrary coroutine function and arguments.
681
682 Cannot suppress exceptions.
683 """
684 _exit_wrapper = self._create_async_cb_wrapper(callback, *args, **kwds)
685
686 # We changed the signature, so using @wraps is not appropriate, but
687 # setting __wrapped__ may still help with introspection.
688 _exit_wrapper.__wrapped__ = callback
689 self._push_exit_callback(_exit_wrapper, False)
690 return callback # Allow use as a decorator
691
692 async def aclose(self):
693 """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