[issue24904] Patch: add timeout to difflib SequenceMatcher ratio() and quick_ratio()

STINNER Victor report at bugs.python.org
Fri Aug 21 00:39:52 CEST 2015


STINNER Victor added the comment:

I'm not sure that it's a good idea to add a timeout to such algorithm. It can be very surprising to have a difference result depending on the system load (CPU usage of _other_ applications) and on the CPU performances.

If you really want this result, I would prefer to design the feature outside the Python stdlib. You might modify the stdlib to allow incremental computation.

About the patch itself, which kind of timer should be used? Monotonic clock? System clock? Process time (CPU time)?

Maybe we can optimize the code?

----------
nosy: +haypo

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue24904>
_______________________________________


More information about the Python-bugs-list mailing list