[issue24384] difflib.SequenceMatcher faster quick_ratio with lower bound specification

2018-06-11 Thread floyd
floyd added the comment: Yes, I agree this should be closed. Especially because my proposed code is so incredibly bad (e.g. regarding performance) that it should be rejected. Back then I was horribly wrong and didn't understand the problem well enough yet. If somebody would like to have

[issue24384] difflib.SequenceMatcher faster quick_ratio with lower bound specification

2018-06-11 Thread Tal Einat
Tal Einat added the comment: Since this is a small enhancement proposal that is not sure to be approved, and there has been no followup for years, I vote to close this. -- ___ Python tracker

[issue24384] difflib.SequenceMatcher faster quick_ratio with lower bound specification

2015-06-08 Thread floyd
floyd added the comment: Agree with the separate function (especially as the return value would change from float to bool). In my experience this is one of the most often occuring use cases for difflib in practice. Another reason is that it is not obvious that the user can optimize it with

[issue24384] difflib.SequenceMatcher faster quick_ratio with lower bound specification

2015-06-08 Thread Tal Einat
Tal Einat added the comment: You should post this on the python-ideas mailing list if you think this should be added to the stdlib. Make sure to reference this issue if you do so. -- ___ Python tracker rep...@bugs.python.org

[issue24384] difflib.SequenceMatcher faster quick_ratio with lower bound specification

2015-06-07 Thread Tal Einat
Tal Einat added the comment: Your second suggestion of adding a 'threshold' parameter to quick_ratio() is a bad idea in my opinion, since it would then be two significantly different functions crammed into one. The separate function would be possible. However, is there a compelling reason

[issue24384] difflib.SequenceMatcher faster quick_ratio with lower bound specification

2015-06-04 Thread Raymond Hettinger
Changes by Raymond Hettinger raymond.hettin...@gmail.com: -- nosy: +tim.peters ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24384 ___ ___

[issue24384] difflib.SequenceMatcher faster quick_ratio with lower bound specification

2015-06-04 Thread floyd
floyd added the comment: Now that I gave it another thought, I think it would be better if we simply add threshold as a named parameter of quick_ratio -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24384

[issue24384] difflib.SequenceMatcher faster quick_ratio with lower bound specification

2015-06-04 Thread floyd
New submission from floyd: 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