This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ghackebeil
Recipients ghackebeil
Date 2016-06-27.01:57:35
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1466992656.21.0.518759698734.issue27396@psf.upfronthosting.co.za>
In-reply-to
Content
I would like to propose changing the default setting for the shallow compare option in filecmp.cmp to False (or providing access an exact comparison function that does not use various performance optimizations).

I think many users will turn to this module as a replacement for the “diff” command on Unix systems, and it is far too easy of a trap to fall into thinking a full comparison takes place when calling filecmp.cmp.

I agree that the shallow compare option is a useful feature, but I think it should be something to opt into as it is more of a performance optimization (the same applies to the caching behavior, but that is for another time).

I understand that the documentation explains the default behavior, but the reality is that many users probably do not understand the consequences of this setting (or simply did not pay close enough attention to the documentation), making it easy for people to use this module wrong and write code that does not work as advertised. I admit to falling into this trap myself.
History
Date User Action Args
2016-06-27 01:57:36ghackebeilsetrecipients: + ghackebeil
2016-06-27 01:57:36ghackebeilsetmessageid: <1466992656.21.0.518759698734.issue27396@psf.upfronthosting.co.za>
2016-06-27 01:57:36ghackebeillinkissue27396 messages
2016-06-27 01:57:35ghackebeilcreate