]> granicus.if.org Git - python/commitdiff
The "with" statement needs a __future__. :)
authorPhillip J. Eby <pje@telecommunity.com>
Mon, 27 Mar 2006 21:42:30 +0000 (21:42 +0000)
committerPhillip J. Eby <pje@telecommunity.com>
Mon, 27 Mar 2006 21:42:30 +0000 (21:42 +0000)
Doc/ref/ref7.tex

index 5188fa1b04cf9210692f37ce4c550b8a55a169d1..a5a6eafcc597c40ef76a3a74174e594cdc595177 100644 (file)
@@ -363,6 +363,17 @@ at the normal location for the kind of exit that was taken.
 
 \end{enumerate}
 
+\begin{notice}
+In Python 2.5, the \keyword{with} statement is only allowed
+when the \code{with_statement} feature has been enabled.  It will always
+be enabled in Python 2.6.  This \code{__future__} import statement can
+be used to enable the feature:
+
+\begin{verbatim}
+from __future__ import with_statement
+\end{verbatim}
+\end{notice}
+
 \begin{seealso}
   \seepep{0343}{The "with" statement}
          {The specification, background, and examples for the