ID EN
Contextlib

enter_context

Python 3.11

Enters a new context manager and adds its __exit__() method to the callback stack. The return value is the result of the context manager’s own __enter__() method.

Syntax

PYTHON
enter_context(cm)

See Also

__exit__() __enter__() with TypeError AttributeError