[Python-Dev] Issue 2986: difflib.SequenceMatcher is partly broken

Terry Reedy tjreedy at udel.edu
Thu Jul 15 08:24:34 CEST 2010


On 7/14/2010 7:32 PM, Tim Peters wrote:
> [Nick Coghlan]
>> You're right, I was misremembering how SequenceMatcher works.
>>
>> Terry's summary of the situation seems correct to me - adding a new
>> flag to the constructor signature would mean we're taking a silent
>> failure ("the heuristic makes my code give the wrong answer on 2.7.0")
>> and making it a noisy failure ("my code needs to be able to turn the
>> heuristic off to get the right answer, so it will fail noisily on
>> 2.7.0").
>
> Yup - exactly so.
>
>> That's a far cry from the True/False mistake.
>
> Which I'm sure refers to introducing True and False builtins in a
> bugfix release.  That was _almost_ as bad as the sometimes-hated
> heuristic I added to SequenceMatcher ;-)
>
> Me, I like "fail noisily on 2.7.0" for this case - practicality beats
> purity, especially when so few people and programs are likely to be
> affected by the
> backwards-incompatible-but-only-for-those-who-need-to-use-it
> SequenceMatcher constructor signature change.

Then tomorrow I will work with Eli on a suggested 2.6/3.1 doc patch
and 2.7 code+doc patch.

-- 
Terry Jan Reedy



More information about the Python-Dev mailing list