From 707bd4e38516f7bb11434dd8590cc5bd0d4810f6 Mon Sep 17 00:00:00 2001 From: Antoine Pitrou Date: Wed, 25 Jul 2012 22:38:33 +0200 Subject: [PATCH] Mention the *limit* argument of TextIO.readline(). --- Doc/library/io.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Doc/library/io.rst b/Doc/library/io.rst index becc4a20b3b..82f29cb1b3e 100644 --- a/Doc/library/io.rst +++ b/Doc/library/io.rst @@ -699,11 +699,13 @@ Text I/O Read and return at most *n* characters from the stream as a single :class:`str`. If *n* is negative or ``None``, reads until EOF. - .. method:: readline() + .. method:: readline(limit=-1) Read until newline or EOF and return a single ``str``. If the stream is already at EOF, an empty string is returned. + If *limit* is specified, at most *limit* characters will be read. + .. method:: seek(offset, whence=SEEK_SET) Change the stream position to the given *offset*. Behaviour depends