diff options
author | Sandro Tosi <sandro.tosi@gmail.com> | 2012-01-14 15:43:14 (GMT) |
---|---|---|
committer | Sandro Tosi <sandro.tosi@gmail.com> | 2012-01-14 15:43:14 (GMT) |
commit | a76bb03c5581d9f7e23c16c394bdad39e2c17782 (patch) | |
tree | 669e92966c3b85f1c1cb7b858cdf60c7f1e3fb30 /Doc/library/stdtypes.rst | |
parent | d6e87f43d608ac6efbb2e61b295462796a899477 (diff) | |
download | cpython-a76bb03c5581d9f7e23c16c394bdad39e2c17782.zip cpython-a76bb03c5581d9f7e23c16c394bdad39e2c17782.tar.gz cpython-a76bb03c5581d9f7e23c16c394bdad39e2c17782.tar.bz2 |
None is not a keyword, link file.next() to functions.html#next
Diffstat (limited to 'Doc/library/stdtypes.rst')
-rw-r--r-- | Doc/library/stdtypes.rst | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst index 4929671..933e326 100644 --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -2372,12 +2372,12 @@ Files have the following methods: A file object is its own iterator, for example ``iter(f)`` returns *f* (unless *f* is closed). When a file is used as an iterator, typically in a :keyword:`for` loop (for example, ``for line in f: print line``), the - :meth:`.next` method is called repeatedly. This method returns the next input + :meth:`next` method is called repeatedly. This method returns the next input line, or raises :exc:`StopIteration` when EOF is hit when the file is open for reading (behavior is undefined when the file is open for writing). In order to make a :keyword:`for` loop the most efficient way of looping over the lines of a file (a very common operation), the :meth:`next` method uses a hidden read-ahead - buffer. As a consequence of using a read-ahead buffer, combining :meth:`.next` + buffer. As a consequence of using a read-ahead buffer, combining :meth:`next` with other file methods (like :meth:`readline`) does not work right. However, using :meth:`seek` to reposition the file to an absolute position will flush the read-ahead buffer. |