Lines Matching refs:ExitStack
473 .. class:: ExitStack()
482 with ExitStack() as stack:
551 Transfers the callback stack to a fresh :class:`ExitStack` instance
559 with ExitStack() as stack:
578 to :class:`ExitStack`, that supports combining both synchronous and
624 The primary use case for :class:`ExitStack` is the one given in the class
631 with ExitStack() as stack:
639 As shown, :class:`ExitStack` also makes it quite easy to use :keyword:`with`
650 method. By using :class:`ExitStack` the steps in the context management
653 stack = ExitStack()
666 only resource management API provided, then :class:`ExitStack` can make it
674 As noted in the documentation of :meth:`ExitStack.push`, this
682 from contextlib import contextmanager, AbstractContextManager, ExitStack
696 with ExitStack() as stack:
738 :class:`ExitStack` makes it possible to instead register a callback for
742 from contextlib import ExitStack
744 with ExitStack() as stack:
756 from contextlib import ExitStack
758 class Callback(ExitStack):
773 :meth:`ExitStack.callback` to declare the resource cleanup in
776 from contextlib import ExitStack
778 with ExitStack() as stack:
942 :class:`ExitStack`, as it invokes *all* currently registered callbacks
946 >>> from contextlib import ExitStack
947 >>> stack = ExitStack()
977 Using separate :class:`ExitStack` instances instead of reusing a single
980 >>> from contextlib import ExitStack
981 >>> with ExitStack() as outer_stack:
983 ... with ExitStack() as inner_stack: