summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2007-08-23 20:55:44 (GMT)
committerGeorg Brandl <georg@python.org>2007-08-23 20:55:44 (GMT)
commita3a68a0db4c375cc7bc7e729a857641a2fdbab6e (patch)
tree09074759fd169a1fe66a57b57435e6ded993e75f
parent154cc588d3b97e6d63418b352f6765ed305a2cb2 (diff)
downloadcpython-a3a68a0db4c375cc7bc7e729a857641a2fdbab6e.zip
cpython-a3a68a0db4c375cc7bc7e729a857641a2fdbab6e.tar.gz
cpython-a3a68a0db4c375cc7bc7e729a857641a2fdbab6e.tar.bz2
Clarify wording a bit.
-rw-r--r--Doc/library/imp.rst24
1 files changed, 13 insertions, 11 deletions
diff --git a/Doc/library/imp.rst b/Doc/library/imp.rst
index cd28b86..a0e5870 100644
--- a/Doc/library/imp.rst
+++ b/Doc/library/imp.rst
@@ -22,13 +22,14 @@ This module provides an interface to the mechanisms used to implement the
.. function:: get_suffixes()
- Return a list of triples, each describing a particular type of module. Each
- triple has the form ``(suffix, mode, type)``, where *suffix* is a string to be
- appended to the module name to form the filename to search for, *mode* is the
- mode string to pass to the built-in :func:`open` function to open the file (this
- can be ``'r'`` for text files or ``'rb'`` for binary files), and *type* is the
- file type, which has one of the values :const:`PY_SOURCE`, :const:`PY_COMPILED`,
- or :const:`C_EXTENSION`, described below.
+ Return a list of 3-element tuples, each describing a particular type of
+ module. Each triple has the form ``(suffix, mode, type)``, where *suffix* is
+ a string to be appended to the module name to form the filename to search
+ for, *mode* is the mode string to pass to the built-in :func:`open` function
+ to open the file (this can be ``'r'`` for text files or ``'rb'`` for binary
+ files), and *type* is the file type, which has one of the values
+ :const:`PY_SOURCE`, :const:`PY_COMPILED`, or :const:`C_EXTENSION`, described
+ below.
.. function:: find_module(name[, path])
@@ -44,12 +45,13 @@ This module provides an interface to the mechanisms used to implement the
in as well (on the Mac, it looks for a resource (:const:`PY_RESOURCE`); on
Windows, it looks in the registry which may point to a specific file).
- If search is successful, the return value is a triple ``(file, pathname,
- description)``:
+ If search is successful, the return value is a 3-element tuple ``(file,
+ pathname, description)``:
*file* is an open file object positioned at the beginning, *pathname* is the
- pathname of the file found, and *description* is a triple as contained in the
- list returned by :func:`get_suffixes` describing the kind of module found.
+ pathname of the file found, and *description* is a 3-element tuple as
+ contained in the list returned by :func:`get_suffixes` describing the kind of
+ module found.
If the module does not live in a file, the returned *file* is ``None``,
*pathname* is the empty string, and the *description* tuple contains empty