Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ba7e2c8

Browse files
committed
Add some text to make the dircmp object section more readable, and move
some stuff around.
1 parent 87068f1 commit ba7e2c8

1 file changed

Lines changed: 16 additions & 7 deletions

File tree

Doc/lib/libfilecmp.tex

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ \section{\module{filecmp} ---
66
\modulesynopsis{Compare files efficiently.}
77

88

9-
The \module{filecmp} module defines functions to compare files and directories,
10-
with various optional time/correctness trade-offs.
9+
The \module{filecmp} module defines functions to compare files and
10+
directories, with various optional time/correctness trade-offs.
1111

12-
The \module{filecmp} module defines the following function:
12+
The \module{filecmp} module defines the following functions:
1313

1414
\begin{funcdesc}{cmp}{f1, f2\optional{, shallow\optional{, use_statcache}}}
1515
Compare the files named \var{f1} and \var{f2}, returning \code{1} if
@@ -58,13 +58,17 @@ \section{\module{filecmp} ---
5858

5959
\subsection{The \protect\class{dircmp} class \label{dircmp-objects}}
6060

61+
\class{dircmp} instances are built using this constructor:
62+
6163
\begin{classdesc}{dircmp}{a, b\optional{, ignore\optional{, hide}}}
6264
Construct a new directory comparison object, to compare the
6365
directories \var{a} and \var{b}. \var{ignore} is a list of names to
6466
ignore, and defaults to \code{['RCS', 'CVS', 'tags']}. \var{hide} is a
6567
list of names to hide, and defaults to \code{[os.curdir, os.pardir]}.
6668
\end{classdesc}
6769

70+
The \class{dircmp} class provides the following methods:
71+
6872
\begin{methoddesc}[dircmp]{report}{}
6973
Print (to \code{sys.stdout}) a comparison between \var{a} and \var{b}.
7074
\end{methoddesc}
@@ -79,6 +83,15 @@ \subsection{The \protect\class{dircmp} class \label{dircmp-objects}}
7983
subdirctories (recursively).
8084
\end{methoddesc}
8185

86+
87+
The \class{dircmp} offers a number of interesting attributes that may
88+
be used to get various bits of information about the directory trees
89+
being compared.
90+
91+
Note that via \method{__getattr__()} hooks, all attributes are
92+
computed lazilly, so there is no speed penalty if only those
93+
attributes which are lightweight to compute are used.
94+
8295
\begin{memberdesc}[dircmp]{left_list}
8396
Files and subdirectories in \var{a}, filtered by \var{hide} and
8497
\var{ignore}.
@@ -132,7 +145,3 @@ \subsection{The \protect\class{dircmp} class \label{dircmp-objects}}
132145
A dictionary mapping names in \member{common_dirs} to
133146
\class{dircmp} objects.
134147
\end{memberdesc}
135-
136-
Note that via \method{__getattr__()} hooks, all attributes are
137-
computed lazilly, so there is no speed penalty if only those
138-
attributes which are lightweight to compute are used.

0 commit comments

Comments
 (0)