summaryrefslogtreecommitdiffstats
path: root/Doc/library/io.rst
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2009-10-01 16:24:45 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2009-10-01 16:24:45 (GMT)
commit78ddbe69af968f1161a20a27bc40dfac7a5f63db (patch)
treed33fb160d57e9cc1be353f98d0dda724271e7b9d /Doc/library/io.rst
parent56e0966afac444a4f198f9770e13b13e2bdeaf03 (diff)
downloadcpython-78ddbe69af968f1161a20a27bc40dfac7a5f63db.zip
cpython-78ddbe69af968f1161a20a27bc40dfac7a5f63db.tar.gz
cpython-78ddbe69af968f1161a20a27bc40dfac7a5f63db.tar.bz2
Issue #7022: clarification of RawIOBase.read(), suggested by Pascal Chambon.
Diffstat (limited to 'Doc/library/io.rst')
-rw-r--r--Doc/library/io.rst13
1 files changed, 8 insertions, 5 deletions
diff --git a/Doc/library/io.rst b/Doc/library/io.rst
index 6432d99..5188b51 100644
--- a/Doc/library/io.rst
+++ b/Doc/library/io.rst
@@ -326,11 +326,14 @@ I/O Base Classes
.. method:: read(n=-1)
- Read and return up to *n* bytes from the stream. As a convenience, if
- *n* is unspecified or -1, :meth:`readall` is called. Otherwise,
- only one system call is ever made. An empty bytes object is returned
- on EOF; ``None`` is returned if the object is set not to block and has
- no data to read.
+ Read up to *n* bytes from the object and return them. As a convenience,
+ if *n* is unspecified or -1, :meth:`readall` is called. Otherwise,
+ only one system call is ever made. Fewer than *n* bytes may be
+ returned if the operating system call returns fewer than *n* bytes.
+
+ If 0 bytes are returned, and *n* was not 0, this indicates end of file.
+ If the object is in non-blocking mode and no bytes are available,
+ ``None`` is returned.
.. method:: readall()