]> granicus.if.org Git - python/commitdiff
Note that files are iterable; describe what the iterator returns.
authorFred Drake <fdrake@acm.org>
Sat, 22 Sep 2001 04:34:48 +0000 (04:34 +0000)
committerFred Drake <fdrake@acm.org>
Sat, 22 Sep 2001 04:34:48 +0000 (04:34 +0000)
This closes SF bug #463738.

Doc/lib/libstdtypes.tex

index 5815f8c24c9f724b4187deaea46b28fa7e6440cf..a79e14294547d6c8d76400cd97673f4540c6a377 100644 (file)
@@ -1319,6 +1319,11 @@ Files have the following methods:
 \end{methoddesc}
 
 
+Files support the iterator protocol.  Each iteration returns the same
+result as \code{\var{file}.readline()}, and iteration ends when the
+\method{readline()} method returns an empty string.
+
+
 File objects also offer a number of other interesting attributes.
 These are not required for file-like objects, but should be
 implemented if they make sense for the particular object.