Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
d4cb9947
Commit
d4cb9947
authored
Feb 02, 2014
by
R David Murray
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
whatsnew: filecmp.clear_cache, and reword description of cache in docs.
parent
19eb0636
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
6 deletions
+17
-6
Doc/library/filecmp.rst
Doc/library/filecmp.rst
+4
-4
Doc/whatsnew/3.4.rst
Doc/whatsnew/3.4.rst
+11
-0
Lib/filecmp.py
Lib/filecmp.py
+2
-2
No files found.
Doc/library/filecmp.rst
View file @
d4cb9947
...
@@ -28,8 +28,8 @@ The :mod:`filecmp` module defines the following functions:
...
@@ -28,8 +28,8 @@ The :mod:`filecmp` module defines the following functions:
portability and efficiency.
portability and efficiency.
This function uses a cache for past comparisons and the results,
This function uses a cache for past comparisons and the results,
with
a cache invalidation mechanism relying on stale signatures
with
cache entries invalidated if the :func:`os.stat` information for the
or by explicitly call
ing :func:`clear_cache`.
file changes. The entire cache may be cleared us
ing :func:`clear_cache`.
.. function:: cmpfiles(dir1, dir2, common, shallow=True)
.. function:: cmpfiles(dir1, dir2, common, shallow=True)
...
@@ -54,12 +54,12 @@ The :mod:`filecmp` module defines the following functions:
...
@@ -54,12 +54,12 @@ The :mod:`filecmp` module defines the following functions:
.. function:: clear_cache()
.. function:: clear_cache()
.. versionadded:: 3.4
Clear the filecmp cache. This may be useful if a file is compared so quickly
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
after it is modified that it is within the mtime resolution of
the underlying filesystem.
the underlying filesystem.
.. versionadded:: 3.4
.. _dircmp-objects:
.. _dircmp-objects:
...
...
Doc/whatsnew/3.4.rst
View file @
d4cb9947
...
@@ -675,6 +675,17 @@ handling).
...
@@ -675,6 +675,17 @@ handling).
(Contributed by R. David Murray in :issue:`18891`.)
(Contributed by R. David Murray in :issue:`18891`.)
filecmp
-------
A new :func:`~filecmp.clear_cache` function provides the ability to clear the
:mod:`filecmp` comparison cache, which uses :func:`os.stat` information to
determine if the file has changed since the last compare. This can be used,
for example, if the file might have been changed and re-checked in less time
than the resolution of a particular filesystem's file modification time field.
(Contributed by Mark Levitt in :issue:`18149`.)
functools
functools
---------
---------
...
...
Lib/filecmp.py
View file @
d4cb9947
...
@@ -43,8 +43,8 @@ def cmp(f1, f2, shallow=True):
...
@@ -43,8 +43,8 @@ def cmp(f1, f2, shallow=True):
True if the files are the same, False otherwise.
True if the files are the same, False otherwise.
This function uses a cache for past comparisons and the results,
This function uses a cache for past comparisons and the results,
with
a cache invalidation mechanism relying on stale signatures
with
cache entries invalidated if their stat information
or by explicitl
y calling clear_cache().
changes. The cache may be cleared b
y calling clear_cache().
"""
"""
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment