summaryrefslogtreecommitdiff
path: root/Doc
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2001-12-12 06:06:43 +0000
committerFred Drake <fdrake@acm.org>2001-12-12 06:06:43 +0000
commita78e66ff0209568214f5d8b8e35e4bf2033724ab (patch)
treec6f5ae970eafab04897c0d9d68187bfab0d1dc71 /Doc
parentebf34dff2c239101790b2889ca817197a3adfb1b (diff)
downloadcpython-a78e66ff0209568214f5d8b8e35e4bf2033724ab.tar.gz
Add a note about yield requiring a __future__ directive.
Diffstat (limited to 'Doc')
-rw-r--r--Doc/ref/ref6.tex10
1 files changed, 10 insertions, 0 deletions
diff --git a/Doc/ref/ref6.tex b/Doc/ref/ref6.tex
index 1f1486bac7..3089b1af38 100644
--- a/Doc/ref/ref6.tex
+++ b/Doc/ref/ref6.tex
@@ -482,6 +482,16 @@ difficulty is that there's no guarantee the generator will ever be
resumed, hence no guarantee that the \keyword{finally} block will ever
get executed.
+\note{In Python 2.2, the \keyword{yield} statement is only allowed
+when the \code{generators} feature has been enabled. It will always
+be enabled in Python 2.3. This \code{__future__} import statment can
+be used to enable the feature:}
+
+\begin{verbatim}
+from __future__ import generators
+\end{verbatim}
+
+
\begin{seealso}
\seepep{0255}{Simple Generators}
{The proposal for adding generators and the \keyword{yield}