Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 038d264

Browse files
committed
Note that files are iterable; describe what the iterator returns.
This closes SF bug #463738.
1 parent 7f8ff47 commit 038d264

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

Doc/lib/libstdtypes.tex

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1319,6 +1319,11 @@ \subsubsection{File Objects\obindex{file}
13191319
\end{methoddesc}
13201320

13211321

1322+
Files support the iterator protocol. Each iteration returns the same
1323+
result as \code{\var{file}.readline()}, and iteration ends when the
1324+
\method{readline()} method returns an empty string.
1325+
1326+
13221327
File objects also offer a number of other interesting attributes.
13231328
These are not required for file-like objects, but should be
13241329
implemented if they make sense for the particular object.

0 commit comments

Comments
 (0)