File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99
1010--------------
1111
12- The :mod: `linecache ` module allows one to get any line from any file, while
12+ The :mod: `linecache ` module allows one to get any line from a Python source file, while
1313attempting to optimize internally, using a cache, the common case where many
1414lines are read from a single file. This is used by the :mod: `traceback ` module
1515to retrieve source lines for inclusion in the formatted traceback.
1616
17+ The :func: `tokenize.open ` function is used to open Python source files. This
18+ function uses :func: `tokenize.detect_encoding ` to get the encoding of the
19+ Python source file.
20+
1721The :mod: `linecache ` module defines the following functions:
1822
1923
@@ -49,4 +53,3 @@ Example::
4953 >>> import linecache
5054 >>> linecache.getline('/etc/passwd', 4)
5155 'sys:x:3:3:sys:/dev:/bin/sh\n'
52-
You can’t perform that action at this time.
0 commit comments