Author floyd
Recipients floyd
Date 2015-06-04.20:12:52
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
I guess a lot of users of difflib call the SequenceMatcher in the following way (where a and b often have different lengths):

if difflib.SequenceMatcher.quick_ratio(None, a, b) >= threshold:

However, for this use case the current quick_ratio is quite a performance loss. Therefore I propose to add an additional, optimized version quick_ratio_ge which would be called like this:

if difflib.SequenceMatcher.quick_ratio_ge(None, a, b, threshold):

As we are able to calculate upper bounds for threshold depending on the lengths of a and b this function would return much faster in a lot of cases.

An example of how quick_ratio_ge could be implemented is attached.
Date User Action Args
2015-06-04 20:12:55floydsetrecipients: + floyd
2015-06-04 20:12:55floydsetmessageid: <>
2015-06-04 20:12:55floydlinkissue24384 messages
2015-06-04 20:12:54floydcreate