Mercurial > cpython-lru_cache-weakref
diff Doc/lib/libfileinput.tex @ 36594:781654be55ef legacy-trunk
Patch #1215184: fileinput now has a fileno() function for getting the
current file number.
| author | Georg Brandl <georg@python.org> |
|---|---|
| date | Sun, 19 Feb 2006 13:56:17 +0000 |
| parents | a0a8f15401db |
| children | c6fba456227b |
line wrap: on
line diff
--- a/Doc/lib/libfileinput.tex Sun Feb 19 13:26:36 2006 +0000 +++ b/Doc/lib/libfileinput.tex Sun Feb 19 13:56:17 2006 +0000 @@ -62,6 +62,12 @@ line has been read, returns \code{None}. \end{funcdesc} +\begin{funcdesc}{fileno}{} + Return the integer ``file descriptor'' for the current file. When no + file is opened (before the first line and between files), returns + \code{-1}. +\end{funcdesc} + \begin{funcdesc}{lineno}{} Return the cumulative line number of the line that has just been read. Before the first line has been read, returns \code{0}. After @@ -107,10 +113,11 @@ \begin{classdesc}{FileInput}{\optional{files\optional{, inplace\optional{, backup}}}} Class \class{FileInput} is the implementation; its methods - \method{filename()}, \method{lineno()}, \method{fileline()}, - \method{isfirstline()}, \method{isstdin()}, \method{nextfile()} and - \method{close()} correspond to the functions of the same name in the - module. In addition it has a \method{readline()} method which + \method{filename()}, \method{fileno()}, \method{lineno()}, + \method{fileline()}, \method{isfirstline()}, \method{isstdin()}, + \method{nextfile()} and \method{close()} correspond to the functions + of the same name in the module. + In addition it has a \method{readline()} method which returns the next input line, and a \method{__getitem__()} method which implements the sequence behavior. The sequence must be accessed in strictly sequential order; random access and
