\declaremodule{standard}{contextlib}
\modulesynopsis{Utilities for \keyword{with}-statement contexts.}
+\versionadded{2.5}
+
This module provides utilities for common tasks involving the
\keyword{with} statement.
\subsection{Context Managers and Contexts\label{context-managers}}
+\versionadded{2.5}
+
A \dfn{context manager} is an object that manages the entry to, and exit
from, a \dfn{context} surrounding a block of code. Context managers are
normally invoked using the \keyword{with} statement (described in
\section{The \keyword{with} statement\label{with}}
\stindex{with}
+\versionadded{2.5}
+
The \keyword{with} statement is used to wrap the execution of a block
with methods defined by a context manager (see
section~\ref{context-managers}). This allows common