mirror of
https://github.com/python/cpython.git
synced 2025-08-03 00:23:06 +00:00
Note that files are iterable; describe what the iterator returns.
This closes SF bug #463738.
This commit is contained in:
parent
7f8ff471f8
commit
038d26410d
1 changed files with 5 additions and 0 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue