Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 707bd4e

Browse files
committed
Mention the *limit* argument of TextIO.readline().
1 parent 393e23f commit 707bd4e

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

Doc/library/io.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -699,11 +699,13 @@ Text I/O
699699
Read and return at most *n* characters from the stream as a single
700700
:class:`str`. If *n* is negative or ``None``, reads until EOF.
701701

702-
.. method:: readline()
702+
.. method:: readline(limit=-1)
703703

704704
Read until newline or EOF and return a single ``str``. If the stream is
705705
already at EOF, an empty string is returned.
706706

707+
If *limit* is specified, at most *limit* characters will be read.
708+
707709
.. method:: seek(offset, whence=SEEK_SET)
708710

709711
Change the stream position to the given *offset*. Behaviour depends

0 commit comments

Comments
 (0)