summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2012-01-13 18:41:25 (GMT)
committerGeorg Brandl <georg@python.org>2012-01-13 18:41:25 (GMT)
commitbc3b682923a22b89b0f5462ee2e807a4cc4ea81d (patch)
treed9842f6dfe5185783fe797d62c2e8e43efdff593 /Doc
parent5136ac0ca21a05691978df8d0650f902c8ca3463 (diff)
downloadcpython-bc3b682923a22b89b0f5462ee2e807a4cc4ea81d.zip
cpython-bc3b682923a22b89b0f5462ee2e807a4cc4ea81d.tar.gz
cpython-bc3b682923a22b89b0f5462ee2e807a4cc4ea81d.tar.bz2
Closes #13761: add a "flush" keyword argument to print().
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/functions.rst11
1 files changed, 7 insertions, 4 deletions
diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst
index c845283..e4b14b8 100644
--- a/Doc/library/functions.rst
+++ b/Doc/library/functions.rst
@@ -946,7 +946,7 @@ are always available. They are listed here in alphabetical order.
must be of integer types, and *y* must be non-negative.
-.. function:: print([object, ...], *, sep=' ', end='\\n', file=sys.stdout)
+.. function:: print([object, ...], *, sep=' ', end='\\n', file=sys.stdout, flush=False)
Print *object*\(s) to the stream *file*, separated by *sep* and followed by
*end*. *sep*, *end* and *file*, if present, must be given as keyword
@@ -959,9 +959,12 @@ are always available. They are listed here in alphabetical order.
*end*.
The *file* argument must be an object with a ``write(string)`` method; if it
- is not present or ``None``, :data:`sys.stdout` will be used. Output buffering
- is determined by *file*. Use ``file.flush()`` to ensure, for instance,
- immediate appearance on a screen.
+ is not present or ``None``, :data:`sys.stdout` will be used. Whether output
+ is buffered is usually determined by *file*, but if the *flush* keyword
+ argument is true, the stream is forcibly flushed.
+
+ .. versionchanged:: 3.3
+ Added the *flush* keyword argument.
.. function:: property(fget=None, fset=None, fdel=None, doc=None)