mirror of
https://github.com/python/cpython.git
synced 2025-08-19 08:11:46 +00:00
clarify condition for readline to return EOF (closes #11312)
This commit is contained in:
parent
5ddf51f735
commit
4f1a665fae
1 changed files with 6 additions and 5 deletions
|
@ -2388,11 +2388,12 @@ Files have the following methods:
|
||||||
|
|
||||||
.. method:: file.readline([size])
|
.. method:: file.readline([size])
|
||||||
|
|
||||||
Read one entire line from the file. A trailing newline character is kept in the
|
Read one entire line from the file. A trailing newline character is kept in
|
||||||
string (but may be absent when a file ends with an incomplete line). [#]_ If
|
the string (but may be absent when a file ends with an incomplete line). [#]_
|
||||||
the *size* argument is present and non-negative, it is a maximum byte count
|
If the *size* argument is present and non-negative, it is a maximum byte
|
||||||
(including the trailing newline) and an incomplete line may be returned. An
|
count (including the trailing newline) and an incomplete line may be
|
||||||
empty string is returned *only* when EOF is encountered immediately.
|
returned. When *size* is not 0, an empty string is returned *only* when EOF
|
||||||
|
is encountered immediately.
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue