From: Fred Drake Date: Sat, 22 Sep 2001 04:34:48 +0000 (+0000) Subject: Note that files are iterable; describe what the iterator returns. X-Git-Tag: v2.2.1c1~1683 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=038d26410dba1ab0a84804ff52c732e243df6f6a;p=python Note that files are iterable; describe what the iterator returns. This closes SF bug #463738. --- diff --git a/Doc/lib/libstdtypes.tex b/Doc/lib/libstdtypes.tex index 5815f8c24c..a79e142945 100644 --- a/Doc/lib/libstdtypes.tex +++ b/Doc/lib/libstdtypes.tex @@ -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.