diff options
author | Fred Drake <fdrake@acm.org> | 2001-09-22 04:34:48 (GMT) |
---|---|---|
committer | Fred Drake <fdrake@acm.org> | 2001-09-22 04:34:48 (GMT) |
commit | 038d26410dba1ab0a84804ff52c732e243df6f6a (patch) | |
tree | 58824460c4faae07fca8698b5f6f6e3cfb266f98 /Doc | |
parent | 7f8ff471f8020ab4c365c4e1885290cbfc08f718 (diff) | |
download | cpython-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.
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/lib/libstdtypes.tex | 5 |
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. |