Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8c0a242

Browse files
committed
PEP 214, Extended print Statement, has been accepted by the BDFL.
Document the extended print form. Fred, please double check the markup!
1 parent 23c9ec8 commit 8c0a242

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

Doc/ref/ref6.tex

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,18 @@ \section{The \keyword{print} statement \label{print}}
330330
\withsubitem{(in module sys)}{\ttindex{stdout}}
331331
\exindex{RuntimeError}
332332

333+
\keyword{print} also has an extended form, defined as
334+
335+
\begin{verbatim}
336+
print_stmt: '>>' expression [ (',' expression)+ [','] ] )
337+
\end{verbatim}
338+
339+
In this form, the first expression after the \keyword{>>} must
340+
evaluate to a ``file-like'' object, specifically an object that has a
341+
\method{write()} method as described above. With the extended form,
342+
the subsequent expressions are printed to this file-like object
343+
instead of \code{sys.stdout}.
344+
333345
\section{The \keyword{return} statement \label{return}}
334346
\stindex{return}
335347

0 commit comments

Comments
 (0)