6.7 cmp -- File comparisons

The cmp module defines a function to compare files, taking all sort of short-cuts to make it a highly efficient operation.

The cmp module defines the following function:

cmp (f1, f2)
Compare two files given as names. The following tricks are used to optimize the comparisons:


>>> import cmp
>>> cmp.cmp('libundoc.tex', 'libundoc.tex')
>>> cmp.cmp('libundoc.tex', 'lib.tex')

Send comments on this document to python-docs@python.org.