bpo-42958: Improve description of shallow= in filecmp.cmp docs (GH-27166)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Co-authored-by: Alexander Vandenbulcke <alexander.vandenbulcke95@gmail.com>
This commit is contained in:
andrei kulakov 2021-08-04 15:39:45 -04:00 committed by GitHub
parent 7c5dab4340
commit a8dc4893d2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 4 deletions

View file

@ -22,8 +22,11 @@ The :mod:`filecmp` module defines the following functions:
Compare the files named *f1* and *f2*, returning ``True`` if they seem equal,
``False`` otherwise.
If *shallow* is true, files with identical :func:`os.stat` signatures are
taken to be equal. Otherwise, the contents of the files are compared.
If *shallow* is true and the :func:`os.stat` signatures (file type, size, and
modification time) of both files are identical, the files are taken to be
equal.
Otherwise, the files are treated as different if their sizes or contents differ.
Note that no external programs are called from this function, giving it
portability and efficiency.