diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2015-03-18 13:14:52 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2015-03-18 13:14:52 (GMT) |
commit | 58b8f3923eb44ba250d3582f5a0e8a8209edcdda (patch) | |
tree | 4e3d053bc02e13a4ee7a1e3cbd00a735781d86ed /Doc | |
parent | de311345584af1dc0fa1514d5f94bea0ea867e09 (diff) | |
parent | 93f0665fb612f08f3a4e6dc5d9d5350ddad6b653 (diff) | |
download | cpython-58b8f3923eb44ba250d3582f5a0e8a8209edcdda.zip cpython-58b8f3923eb44ba250d3582f5a0e8a8209edcdda.tar.gz cpython-58b8f3923eb44ba250d3582f5a0e8a8209edcdda.tar.bz2 |
Merge 3.4 (linecache doc)
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/linecache.rst | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Doc/library/linecache.rst b/Doc/library/linecache.rst index 12d0113..52e3339 100644 --- a/Doc/library/linecache.rst +++ b/Doc/library/linecache.rst @@ -9,11 +9,15 @@ -------------- -The :mod:`linecache` module allows one to get any line from any file, while +The :mod:`linecache` module allows one to get any line from a Python source file, while attempting to optimize internally, using a cache, the common case where many lines are read from a single file. This is used by the :mod:`traceback` module to retrieve source lines for inclusion in the formatted traceback. +The :func:`tokenize.open` function is used to open Python source files. This +function uses :func:`tokenize.detect_encoding` to get the encoding of the +Python source file. + The :mod:`linecache` module defines the following functions: @@ -57,4 +61,3 @@ Example:: >>> import linecache >>> linecache.getline('/etc/passwd', 4) 'sys:x:3:3:sys:/dev:/bin/sh\n' - |