gh-154661: Reorganize difflib documentation - #154662
Conversation
- Put common information in an intro section at the beginning, rather than in a duplicate doc entry for `SequenceMatcher` - Merge the two doc entries for `Differ` - Document timing as a CPython implementation detail - Group examples together
Documentation build overview
7 files changed ·
|
| The basic Ratcliff-Obershelp algorithm is cubic time in the worst | ||
| case and quadratic time in the expected case. | ||
| :mod:`difflib`'s algorithm is quadratic time for the worst case and has | ||
| expected-case behavior dependent in a complicated way on how many elements |
There was a problem hiding this comment.
| expected-case behavior dependent in a complicated way on how many elements | |
| expected-case behavior dependent on a complicated way on how many elements |
There was a problem hiding this comment.
in is correct here -- the behaviour depends on how many elements the sequences have in common, but the relation isn't linear, or quadratic, or otherwise simple.
| because they synch up anywhere possible, sometimes at accidental matches | ||
| 100 pages apart. | ||
| Restricting synch points to contiguous matches preserves some notion of |
There was a problem hiding this comment.
We use "sync" everywhere else, and avoids mispronunciation as "sinch" (which I have heard):
| because they synch up anywhere possible, sometimes at accidental matches | |
| 100 pages apart. | |
| Restricting synch points to contiguous matches preserves some notion of | |
| because they sync up anywhere possible, sometimes at accidental matches | |
| 100 pages apart. | |
| Restricting sync points to contiguous matches preserves some notion of |
There was a problem hiding this comment.
This PR just moves this text; I'd rather keep the original wording unchanged.
Merriam-Webster recognizes both sync & synch.
There was a problem hiding this comment.
And acknowledges "less commonly synch" :) But fine to keep it as is in this PR.
There was a problem hiding this comment.
There's no harm in keeping some of the page's old-timey charm :)
| be ignored. Read the description of the | ||
| :meth:`~SequenceMatcher.find_longest_match` method's *isjunk* |
There was a problem hiding this comment.
Perhaps? (and may need an escape)
| be ignored. Read the description of the | |
| :meth:`~SequenceMatcher.find_longest_match` method's *isjunk* | |
| be ignored. Read the description of | |
| :meth:`~SequenceMatcher.find_longest_match`'s *isjunk* |
There was a problem hiding this comment.
Let's keep the original for now.
|
And let's backport (if trivial). |
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
encukou
left a comment
There was a problem hiding this comment.
Thanks for proofreading!
| The basic Ratcliff-Obershelp algorithm is cubic time in the worst | ||
| case and quadratic time in the expected case. | ||
| :mod:`difflib`'s algorithm is quadratic time for the worst case and has | ||
| expected-case behavior dependent in a complicated way on how many elements |
There was a problem hiding this comment.
in is correct here -- the behaviour depends on how many elements the sequences have in common, but the relation isn't linear, or quadratic, or otherwise simple.
| because they synch up anywhere possible, sometimes at accidental matches | ||
| 100 pages apart. | ||
| Restricting synch points to contiguous matches preserves some notion of |
There was a problem hiding this comment.
This PR just moves this text; I'd rather keep the original wording unchanged.
Merriam-Webster recognizes both sync & synch.
| be ignored. Read the description of the | ||
| :meth:`~SequenceMatcher.find_longest_match` method's *isjunk* |
There was a problem hiding this comment.
Let's keep the original for now.
| because they synch up anywhere possible, sometimes at accidental matches | ||
| 100 pages apart. | ||
| Restricting synch points to contiguous matches preserves some notion of |
There was a problem hiding this comment.
And acknowledges "less commonly synch" :) But fine to keep it as is in this PR.
|
Thanks @encukou for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14, 3.15. |
|
GH-154805 is a backport of this pull request to the 3.15 branch. |
|
GH-154806 is a backport of this pull request to the 3.14 branch. |
|
GH-154807 is a backport of this pull request to the 3.13 branch. |
SequenceMatcherDiffer