Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
bpo-32797: improve documentation of linecache.getline
  • Loading branch information
jdemeyer committed Oct 9, 2018
commit 3ff70b66ee657397fec00b1ff91be150779a04b9
11 changes: 7 additions & 4 deletions Doc/library/linecache.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,13 @@ The :mod:`linecache` module defines the following functions:

.. index:: triple: module; search; path

If a file named *filename* is not found, the function will look for it in the
module search path, ``sys.path``, after first checking for a :pep:`302`
``__loader__`` in *module_globals*, in case the module was imported from a
zipfile or other non-filesystem import source.
If a file named *filename* is not found, the function first checks
for a :pep:`302` ``__loader__`` in *module_globals*.
If there is such a loader and it defines a ``get_source`` method,
then that determines the source lines
(if ``get_source()`` returns ``None``, then ``''`` is returned).
Finally, if *filename* is a relative filename,
it is looked up relative to the entries in the module search path, ``sys.path``.


.. function:: clearcache()
Expand Down