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

Skip to content

Commit cf4d699

Browse files
committed
Merge with 3.4
2 parents f7b2aa5 + 1895f2b commit cf4d699

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

Doc/library/functions.rst

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1083,8 +1083,8 @@ are always available. They are listed here in alphabetical order.
10831083

10841084
.. function:: print(*objects, sep=' ', end='\\n', file=sys.stdout, flush=False)
10851085

1086-
Print *objects* to the stream *file*, separated by *sep* and followed by
1087-
*end*. *sep*, *end* and *file*, if present, must be given as keyword
1086+
Print *objects* to the text stream *file*, separated by *sep* and followed
1087+
by *end*. *sep*, *end* and *file*, if present, must be given as keyword
10881088
arguments.
10891089

10901090
All non-keyword arguments are converted to strings like :func:`str` does and
@@ -1094,9 +1094,12 @@ are always available. They are listed here in alphabetical order.
10941094
*end*.
10951095

10961096
The *file* argument must be an object with a ``write(string)`` method; if it
1097-
is not present or ``None``, :data:`sys.stdout` will be used. Whether output
1098-
is buffered is usually determined by *file*, but if the *flush* keyword
1099-
argument is true, the stream is forcibly flushed.
1097+
is not present or ``None``, :data:`sys.stdout` will be used. Since printed
1098+
arguments are converted to text strings, :func:`print` cannot be used with
1099+
binary mode file objects. For these, use ``file.write(...)`` instead.
1100+
1101+
Whether output is buffered is usually determined by *file*, but if the
1102+
*flush* keyword argument is true, the stream is forcibly flushed.
11001103

11011104
.. versionchanged:: 3.3
11021105
Added the *flush* keyword argument.

0 commit comments

Comments
 (0)