summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2001-09-22 04:34:48 (GMT)
committerFred Drake <fdrake@acm.org>2001-09-22 04:34:48 (GMT)
commit038d26410dba1ab0a84804ff52c732e243df6f6a (patch)
tree58824460c4faae07fca8698b5f6f6e3cfb266f98
parent7f8ff471f8020ab4c365c4e1885290cbfc08f718 (diff)
downloadcpython-038d26410dba1ab0a84804ff52c732e243df6f6a.zip
cpython-038d26410dba1ab0a84804ff52c732e243df6f6a.tar.gz
cpython-038d26410dba1ab0a84804ff52c732e243df6f6a.tar.bz2
Note that files are iterable; describe what the iterator returns.
This closes SF bug #463738.
-rw-r--r--Doc/lib/libstdtypes.tex5
1 files changed, 5 insertions, 0 deletions
diff --git a/Doc/lib/libstdtypes.tex b/Doc/lib/libstdtypes.tex
index 5815f8c..a79e142 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.