mirror of
https://github.com/python/cpython.git
synced 2025-11-14 07:49:28 +00:00
#6448: clarify docs for find_module().
This commit is contained in:
parent
0294de028f
commit
7c150bf904
1 changed files with 11 additions and 10 deletions
|
|
@ -34,16 +34,17 @@ This module provides an interface to the mechanisms used to implement the
|
||||||
|
|
||||||
.. function:: find_module(name[, path])
|
.. function:: find_module(name[, path])
|
||||||
|
|
||||||
Try to find the module *name* on the search path *path*. If *path* is a list
|
Try to find the module *name*. If *path* is omitted or ``None``, the list of
|
||||||
of directory names, each directory is searched for files with any of the
|
directory names given by ``sys.path`` is searched, but first a few special
|
||||||
suffixes returned by :func:`get_suffixes` above. Invalid names in the list
|
places are searched: the function tries to find a built-in module with the
|
||||||
are silently ignored (but all list items must be strings). If *path* is
|
given name (:const:`C_BUILTIN`), then a frozen module (:const:`PY_FROZEN`),
|
||||||
omitted or ``None``, the list of directory names given by ``sys.path`` is
|
and on some systems some other places are looked in as well (on Windows, it
|
||||||
searched, but first it searches a few special places: it tries to find a
|
looks in the registry which may point to a specific file).
|
||||||
built-in module with the given name (:const:`C_BUILTIN`), then a frozen
|
|
||||||
module (:const:`PY_FROZEN`), and on some systems some other places are looked
|
Otherwise, *path* must be a list of directory names; each directory is
|
||||||
in as well (on Windows, it looks in the registry which may point to a
|
searched for files with any of the suffixes returned by :func:`get_suffixes`
|
||||||
specific file).
|
above. Invalid names in the list are silently ignored (but all list items
|
||||||
|
must be strings).
|
||||||
|
|
||||||
If search is successful, the return value is a 3-element tuple ``(file,
|
If search is successful, the return value is a 3-element tuple ``(file,
|
||||||
pathname, description)``:
|
pathname, description)``:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue