11\section {\module {linecache} ---
2- Treat files like lists of lines }
2+ Random access to text lines }
33
44\declaremodule {standard}{linecache}
55\sectionauthor {Moshe Zadka}{
[email protected] }
6- \modulesynopsis {This module treats files like random-access lists of lines.}
6+ \modulesynopsis {This module provides random access to individual lines
7+ from text files.}
78
89
910The \module {linecache} module allows one to get any line from any file,
1011while attempting to optimize internally, using a cache, the common case
11- where many lines are read from a file.
12+ where many lines are read from a single file. This is used by the
13+ \refmodule {traceback} module to retrieve source lines for inclusion in
14+ the formatted traceback.
1215
1316The \module {linecache} module defines the following functions:
1417
@@ -17,19 +20,19 @@ \section{\module{linecache} ---
1720will never throw an exception --- it will return \code {''} on errors.
1821
1922If a file named \var {filename} is not found, the function will look
20- for it in the module search path.
23+ for it in the module\indexiii {module}{search}{path} search path,
24+ \code {sys.path}.
2125\end {funcdesc }
2226
2327\begin {funcdesc }{clearcache}{}
24- Clear the cache. You might want to use this function if you know that
25- you do not need to read lines from many of files you already read from
26- using this module.
28+ Clear the cache. Use this function if you know that you do not need
29+ to read lines from many of files you already read from using this
30+ module.
2731\end {funcdesc }
2832
2933\begin {funcdesc }{checkcache}{}
30- Check the cache is still valid. You might want to use this function if
31- you suspect that files you read from using this module might have
32- changed.
34+ Check the cache for validity. Use this function if files in the cache
35+ may have changed on disk, and you require the updated version.
3336\end {funcdesc }
3437
3538Example:
0 commit comments