mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
bpo-30718: Add information about text buffering (GH-32351)
This commit is contained in:
parent
26f2e688b8
commit
5101d97d0b
1 changed files with 5 additions and 1 deletions
|
@ -1165,7 +1165,11 @@ are always available. They are listed here in alphabetical order.
|
|||
*buffering* is an optional integer used to set the buffering policy. Pass 0
|
||||
to switch buffering off (only allowed in binary mode), 1 to select line
|
||||
buffering (only usable in text mode), and an integer > 1 to indicate the size
|
||||
in bytes of a fixed-size chunk buffer. When no *buffering* argument is
|
||||
in bytes of a fixed-size chunk buffer. Note that specifying a buffer size this
|
||||
way applies for binary buffered I/O, but ``TextIOWrapper`` (i.e., files opened
|
||||
with ``mode='r+'``) would have another buffering. To disable buffering in
|
||||
``TextIOWrapper``, consider using the ``write_through`` flag for
|
||||
:func:`io.TextIOWrapper.reconfigure`. When no *buffering* argument is
|
||||
given, the default buffering policy works as follows:
|
||||
|
||||
* Binary files are buffered in fixed-size chunks; the size of the buffer is
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue