[Python-checkins] cpython (merge 3.4 -> default): Merge 3.4 (linecache doc)

victor.stinner python-checkins at python.org
Wed Mar 18 14:15:04 CET 2015


https://hg.python.org/cpython/rev/4f3abc65a8b4
changeset:   95039:4f3abc65a8b4
parent:      95037:b44ec269abda
parent:      95038:51341af466e3
user:        Victor Stinner <victor.stinner at gmail.com>
date:        Wed Mar 18 14:14:52 2015 +0100
summary:
  Merge 3.4 (linecache doc)

files:
  Doc/library/linecache.rst |  7 +++++--
  1 files changed, 5 insertions(+), 2 deletions(-)


diff --git a/Doc/library/linecache.rst b/Doc/library/linecache.rst
--- 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 @@
    >>> import linecache
    >>> linecache.getline('/etc/passwd', 4)
    'sys:x:3:3:sys:/dev:/bin/sh\n'
-

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list