Skip to content

Conversation

@tim-one
Copy link
Member

@tim-one tim-one commented May 22, 2024

A different approach, tracking all ascending index pairs achieving the best ratio. None of them needs recursion then. And, more importantly, it restores difflib's general "top to bottom" ordering of matches.

@tim-one tim-one merged commit 07df93d into python:main May 22, 2024
@tim-one tim-one deleted the differ branch May 22, 2024 23:25
estyxx pushed a commit to estyxx/cpython that referenced this pull request Jul 17, 2024
…e cases] (python#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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

difflib.py Differ.compare is too slow [for degenerate cases]

1 participant