Lines Matching refs:ContextDecorator
89 :func:`contextmanager` uses :class:`ContextDecorator` so the context managers
97 Use of :class:`ContextDecorator`.
278 .. class:: ContextDecorator()
282 Context managers inheriting from ``ContextDecorator`` have to implement
286 ``ContextDecorator`` is used by :func:`contextmanager`, so you get this
289 Example of ``ContextDecorator``::
291 from contextlib import ContextDecorator
293 class mycontext(ContextDecorator):
324 ``ContextDecorator`` lets you instead write::
334 using ``ContextDecorator`` as a mixin class::
336 from contextlib import ContextDecorator
338 class mycontext(ContextBaseClass, ContextDecorator):
675 :class:`ContextDecorator` makes it possible to use a context manager in
681 inheriting from :class:`ContextDecorator` provides both capabilities in a
684 from contextlib import ContextDecorator
689 class track_entry_and_exit(ContextDecorator):