[issue1738] filecmp.dircmp does exact match only

Alexander Belopolsky report at bugs.python.org
Fri Apr 11 16:00:40 CEST 2008


Alexander Belopolsky <belopolsky at users.sourceforge.net> added the comment:

+1 on adding the match argument.  Can you comment on how one would 
implement the old behavior? I would guess match=lambda x,y: x in y, 
which is not that bad, but maybe that should be the default and those 
who need pattern matching should use match=fnmatch.

On the patch itself, please don't change default arguments from None to 
lists or function.  There is a subtle difference between the two forms. 
For example, in your code if someone overrides filecmp.fnmatch before 
calling dircmp, old fnmatch will still be used.  If you do match=None in  
finction declaration and match is None check in the function body, then 
the new overridden value will be used in the above scenario.

----------
nosy: +belopolsky

__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue1738>
__________________________________


More information about the Python-bugs-list mailing list