diff options
author | Robert Collins <rbtcollins@hp.com> | 2015-03-04 23:07:57 (GMT) |
---|---|---|
committer | Robert Collins <rbtcollins@hp.com> | 2015-03-04 23:07:57 (GMT) |
commit | 6bc2c1e7ebf359224e5e547f58ffc2c42cb36a39 (patch) | |
tree | a4fa620827bc620fff1bc68f480f35c849ee91e1 /Doc/library/linecache.rst | |
parent | 0bfd0a40486d1eac92572e7272d25e3e405b7aef (diff) | |
download | cpython-6bc2c1e7ebf359224e5e547f58ffc2c42cb36a39.zip cpython-6bc2c1e7ebf359224e5e547f58ffc2c42cb36a39.tar.gz cpython-6bc2c1e7ebf359224e5e547f58ffc2c42cb36a39.tar.bz2 |
Issue #17911: traceback module overhaul
Provide a way to seed the linecache for a PEP-302 module without actually
loading the code.
Provide a new object API for traceback, including the ability to not lookup
lines at all until the traceback is actually rendered, without any trace of the
original objects being kept alive.
Diffstat (limited to 'Doc/library/linecache.rst')
-rw-r--r-- | Doc/library/linecache.rst | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Doc/library/linecache.rst b/Doc/library/linecache.rst index dacf8aa..12d0113 100644 --- a/Doc/library/linecache.rst +++ b/Doc/library/linecache.rst @@ -43,6 +43,14 @@ The :mod:`linecache` module defines the following functions: changed on disk, and you require the updated version. If *filename* is omitted, it will check all the entries in the cache. +.. function:: lazycache(filename, module_globals) + + Capture enough detail about a non-file based module to permit getting its + lines later via :func:`getline` even if *module_globals* is None in the later + call. This avoids doing I/O until a line is actually needed, without having + to carry the module globals around indefinitely. + + .. versionadded:: 3.5 Example:: |