diff options
author | Benjamin Peterson <benjamin@python.org> | 2011-03-12 17:12:54 -0600 |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2011-03-12 17:12:54 -0600 |
commit | 5a5a3341649093614cff0cef18467b752db4f1c4 (patch) | |
tree | f0ca7919fecb1737cb2db31f8558fc0d21494e5c /Doc | |
parent | 7cec6f3d53b44ccc49d6e776df0f30b1bedbca9d (diff) | |
download | cpython-5a5a3341649093614cff0cef18467b752db4f1c4.tar.gz |
clarify condition for readline to return EOF (closes #11312)
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/stdtypes.rst | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst index b532285f64..77c2da7e66 100644 --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -2388,11 +2388,12 @@ Files have the following methods: .. method:: file.readline([size]) - Read one entire line from the file. A trailing newline character is kept in the - string (but may be absent when a file ends with an incomplete line). [#]_ If - the *size* argument is present and non-negative, it is a maximum byte count - (including the trailing newline) and an incomplete line may be returned. An - empty string is returned *only* when EOF is encountered immediately. + Read one entire line from the file. A trailing newline character is kept in + the string (but may be absent when a file ends with an incomplete line). [#]_ + If the *size* argument is present and non-negative, it is a maximum byte + count (including the trailing newline) and an incomplete line may be + returned. When *size* is not 0, an empty string is returned *only* when EOF + is encountered immediately. .. note:: |