Lines Matching refs:ExitStack
354 .. class:: ExitStack()
363 with ExitStack() as stack:
432 Transfers the callback stack to a fresh :class:`ExitStack` instance
440 with ExitStack() as stack:
459 to :class:`ExitStack`, that supports combining both synchronous and
505 The primary use case for :class:`ExitStack` is the one given in the class
512 with ExitStack() as stack:
520 As shown, :class:`ExitStack` also makes it quite easy to use :keyword:`with`
531 method. By using :class:`ExitStack` the steps in the context management
534 stack = ExitStack()
547 only resource management API provided, then :class:`ExitStack` can make it
555 As noted in the documentation of :meth:`ExitStack.push`, this
563 from contextlib import contextmanager, AbstractContextManager, ExitStack
577 with ExitStack() as stack:
619 :class:`ExitStack` makes it possible to instead register a callback for
623 from contextlib import ExitStack
625 with ExitStack() as stack:
637 from contextlib import ExitStack
639 class Callback(ExitStack):
654 :meth:`ExitStack.callback` to declare the resource cleanup in
657 from contextlib import ExitStack
659 with ExitStack() as stack:
823 :class:`ExitStack`, as it invokes *all* currently registered callbacks
827 >>> from contextlib import ExitStack
828 >>> stack = ExitStack()
858 Using separate :class:`ExitStack` instances instead of reusing a single
861 >>> from contextlib import ExitStack
862 >>> with ExitStack() as outer_stack:
864 ... with ExitStack() as inner_stack: