summaryrefslogtreecommitdiffstats
path: root/Doc/library/filecmp.rst
diff options
context:
space:
mode:
authorNed Deily <nad@acm.org>2013-06-14 22:19:11 (GMT)
committerNed Deily <nad@acm.org>2013-06-14 22:19:11 (GMT)
commit7bff3cbe3de7bc96575396ad3fd7bfc6058eaa94 (patch)
tree946c2fb6a2f593ece017c84bc8adf9cd3f1214d2 /Doc/library/filecmp.rst
parent3fe35e65034de82c45e2d8fe1ebe4a2929c68453 (diff)
downloadcpython-7bff3cbe3de7bc96575396ad3fd7bfc6058eaa94.zip
cpython-7bff3cbe3de7bc96575396ad3fd7bfc6058eaa94.tar.gz
cpython-7bff3cbe3de7bc96575396ad3fd7bfc6058eaa94.tar.bz2
Issue #18149: Add filecmp.clear_cache() to manually clear the filecmp cache.
Patch by Mark Levitt
Diffstat (limited to 'Doc/library/filecmp.rst')
-rw-r--r--Doc/library/filecmp.rst13
1 files changed, 13 insertions, 0 deletions
diff --git a/Doc/library/filecmp.rst b/Doc/library/filecmp.rst
index 95c4ddf..8471a72 100644
--- a/Doc/library/filecmp.rst
+++ b/Doc/library/filecmp.rst
@@ -27,6 +27,10 @@ The :mod:`filecmp` module defines the following functions:
Note that no external programs are called from this function, giving it
portability and efficiency.
+ This function uses a cache for past comparisons and the results,
+ with a cache invalidation mechanism relying on stale signatures
+ or by explicitly calling :func:`clear_cache`.
+
.. function:: cmpfiles(dir1, dir2, common, shallow=True)
@@ -48,6 +52,15 @@ The :mod:`filecmp` module defines the following functions:
one of the three returned lists.
+.. function:: clear_cache()
+
+ .. versionadded:: 3.4
+
+ Clear the filecmp cache. This may be useful if a file is compared so quickly
+ after it is modified that it is within the mtime resolution of
+ the underlying filesystem.
+
+
.. _dircmp-objects:
The :class:`dircmp` class