PyDocs

Nav

Python Runtime Services

ContextDecorator

contextlib

class · Added in 3.2 (source)
A base class or mixin that enables context managers to work as decorators.
Changed in 3.15
  • 3.15: Decorating a generator function, coroutine function, or asynchronous generator function now keeps the context manager open across iteration or await. Previously the context manager exited as soon as the generator or coroutine object was created.
0 Examples
No examples for contextlib/ContextDecorator.
See Also
No see-alsos for contextlib/ContextDecorator
0 Notes
No notes for ContextDecorator