]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
PEP 214, Extended print Statement, has been accepted by the BDFL.
authorBarry Warsaw <barry@python.org>
Mon, 21 Aug 2000 15:45:16 +0000 (15:45 +0000)
committerBarry Warsaw <barry@python.org>
Mon, 21 Aug 2000 15:45:16 +0000 (15:45 +0000)
Document the extended print form.  Fred, please double check the
markup!

Doc/ref/ref6.tex

index 3f21479528f97c38d699b8a41107b7fd16664cf4..182148532cfdba23c6266f2ee94c2befb307760d 100644 (file)
@@ -330,6 +330,18 @@ exception is raised.
 \withsubitem{(in module sys)}{\ttindex{stdout}}
 \exindex{RuntimeError}
 
+\keyword{print} also has an extended form, defined as
+
+\begin{verbatim}
+print_stmt: '>>' expression [ (',' expression)+ [','] ] )
+\end{verbatim}
+
+In this form, the first expression after the \keyword{>>} must
+evaluate to a ``file-like'' object, specifically an object that has a
+\method{write()} method as described above.  With the extended form,
+the subsequent expressions are printed to this file-like object
+instead of \code{sys.stdout}.
+
 \section{The \keyword{return} statement \label{return}}
 \stindex{return}