Skip to content

Commit ec7f023

Browse files
committed
tweaks
1 parent 2119f78 commit ec7f023

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

Doc/library/io.rst

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -571,18 +571,19 @@ I/O Base Classes
571571
Read and return up to *size* bytes. If the argument is omitted, ``None``,
572572
or negative read as much as possible.
573573

574-
The default implementation will use ``raw.readall`` if available (
575-
which should implement :meth:`RawIOBase.readall`),
576-
otherwise will read in a loop until read returns ``None``, a size-zero
577-
``bytes``, or a non-retryable error. For most streams this is to EOF, but
578-
for non-blocking streams more data may become available.
579-
580574
Less bytes may be returned than requested. An empty :class:`bytes` object
581575
is returned if the stream is already at EOF. More than one read may be
582576
made, and calls may be retried if specific errors are encountered, see
583577
:meth:`os.read` and :pep:`475` for more details. Less than size bytes
584578
being returned does not imply that EOF is imminent.
585579

580+
When reading as much as possible the default implementation will use
581+
``raw.readall`` if available (which should implement
582+
:meth:`RawIOBase.readall`), otherwise will read in a loop until read
583+
returns ``None``, a size-zero :clss:`bytes`, or a non-retryable error. For
584+
most streams this is to EOF, but for non-blocking streams more data may
585+
become available.
586+
586587
A :exc:`BlockingIOError` is raised if the underlying raw stream is in
587588
non blocking-mode, and has no data available at the moment.
588589

0 commit comments

Comments
 (0)