Mercurial > cpython-lru_cache-weakref
view Doc/lib/libcmp.tex @ 17322:bd110eadc19a legacy-trunk
One-liner critical fix from Jim Fulton: Eric's string-method crusade
got the order backwards in a line (for .find()).
| author | Tim Peters <tim.peters@gmail.com> |
|---|---|
| date | Thu, 05 Apr 2001 22:26:23 +0000 |
| parents | 4b51d069be35 |
| children |
line wrap: on
line source
\section{\module{cmp} --- File comparisons} \declaremodule{standard}{cmp} \sectionauthor{Moshe Zadka}{moshez@zadka.site.co.il} \modulesynopsis{Compare files very efficiently.} \deprecated{1.6}{Use the \refmodule{filecmp} module instead.} The \module{cmp} module defines a function to compare files, taking all sort of short-cuts to make it a highly efficient operation. The \module{cmp} module defines the following function: \begin{funcdesc}{cmp}{f1, f2} Compare two files given as names. The following tricks are used to optimize the comparisons: \begin{itemize} \item Files with identical type, size and mtime are assumed equal. \item Files with different type or size are never equal. \item The module only compares files it already compared if their signature (type, size and mtime) changed. \item No external programs are called. \end{itemize} \end{funcdesc} Example: \begin{verbatim} >>> import cmp >>> cmp.cmp('libundoc.tex', 'libundoc.tex') 1 >>> cmp.cmp('libundoc.tex', 'lib.tex') 0 \end{verbatim}
