mirror of https://github.com/python/cpython
#5363: fix cmpfiles() docs. Another instance where a prose description is twice as long as the code.
This commit is contained in:
parent
da2790c47d
commit
ee6361f7d8
|
@ -31,17 +31,24 @@ The :mod:`filecmp` module defines the following functions:
|
||||||
|
|
||||||
.. function:: cmpfiles(dir1, dir2, common[, shallow])
|
.. function:: cmpfiles(dir1, dir2, common[, shallow])
|
||||||
|
|
||||||
Returns three lists of file names: *match*, *mismatch*, *errors*. *match*
|
Compare the files in the two directories *dir1* and *dir2* whose names are
|
||||||
contains the list of files match in both directories, *mismatch* includes the
|
given by *common*.
|
||||||
names of those that don't, and *errros* lists the names of files which could not
|
|
||||||
be compared. Files may be listed in *errors* because the user may lack
|
|
||||||
permission to read them or many other reasons, but always that the comparison
|
|
||||||
could not be done for some reason.
|
|
||||||
|
|
||||||
The *common* parameter is a list of file names found in both directories. The
|
Returns three lists of file names: *match*, *mismatch*,
|
||||||
*shallow* parameter has the same meaning and default value as for
|
*errors*. *match* contains the list of files that match, *mismatch* contains
|
||||||
|
the names of those that don't, and *errors* lists the names of files which
|
||||||
|
could not be compared. Files are listed in *errors* if they don't exist in
|
||||||
|
one of the directories, the user lacks permission to read them or if the
|
||||||
|
comparison could not be done for some other reason.
|
||||||
|
|
||||||
|
The *shallow* parameter has the same meaning and default value as for
|
||||||
:func:`filecmp.cmp`.
|
:func:`filecmp.cmp`.
|
||||||
|
|
||||||
|
For example, ``cmpfiles('a', 'b', ['c', 'd/e'])`` will compare ``a/c`` with
|
||||||
|
``b/c`` and ``a/d/e`` with ``b/d/e``. ``'c'`` and ``'d/e'`` will each be in
|
||||||
|
one of the three returned lists.
|
||||||
|
|
||||||
|
|
||||||
Example::
|
Example::
|
||||||
|
|
||||||
>>> import filecmp
|
>>> import filecmp
|
||||||
|
|
Loading…
Reference in New Issue