]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-119105: difflib.py Differ.compare is too slow [for degenerate cases] (#119376)
authorTim Peters <tim.peters@gmail.com>
Wed, 22 May 2024 23:25:08 +0000 (18:25 -0500)
committerGitHub <noreply@github.com>
Wed, 22 May 2024 23:25:08 +0000 (18:25 -0500)
commit07df93de73b6bdd4f80cd9e29834d761a0882622
tree81e895b32b7126edfae99ca869e02c0420b2ed63
parente3bf5381fd056d0bbdd775463e3724aab2012e45
gh-119105: difflib.py Differ.compare is too slow [for degenerate cases] (#119376)

Track all pairs achieving the best ratio in Differ(). This repairs the "very deep recursion and cubic time" bad cases in a way that preserves previous output.
Lib/difflib.py
Lib/test/test_difflib.py