Added a test for the ability to specify a class attribute in Formatter configuration...
[python.git] / Doc / lib / libcmp.tex
blob489efee96252452f0999b166d83f19b195cc896c
1 \section{\module{cmp} ---
2 File comparisons}
4 \declaremodule{standard}{cmp}
5 \sectionauthor{Moshe Zadka}{moshez@zadka.site.co.il}
6 \modulesynopsis{Compare files very efficiently.}
8 \deprecated{1.6}{Use the \refmodule{filecmp} module instead.}
10 The \module{cmp} module defines a function to compare files, taking all
11 sort of short-cuts to make it a highly efficient operation.
13 The \module{cmp} module defines the following function:
15 \begin{funcdesc}{cmp}{f1, f2}
16 Compare two files given as names. The following tricks are used to
17 optimize the comparisons:
19 \begin{itemize}
20 \item Files with identical type, size and mtime are assumed equal.
21 \item Files with different type or size are never equal.
22 \item The module only compares files it already compared if their
23 signature (type, size and mtime) changed.
24 \item No external programs are called.
25 \end{itemize}
26 \end{funcdesc}
28 Example:
30 \begin{verbatim}
31 >>> import cmp
32 >>> cmp.cmp('libundoc.tex', 'libundoc.tex')
34 >>> cmp.cmp('libundoc.tex', 'lib.tex')
36 \end{verbatim}