FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-154661: Reorganize difflib documentation by encukou · Pull Request #154662 · python/cpython · GitHub

Repository navigation

gh-154661: Reorganize difflib documentation - #154662

Merged
encukou merged 2 commits into
python:mainfrom
encukou:difflib-doc
Jul 28, 2026
Merged

encukou merged 2 commits into
python:mainfrom
encukou:difflib-doc

Conversation

encukou commented Jul 24, 2026 •
edited by bedevere-app Bot
Loading

Copy link
Copy Markdown
Member
  • 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

- 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

read-the-docs-community Bot commented Jul 24, 2026 •
edited
Loading

Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #33780055 | 📁 Comparing 300edbc against main (59e67c2)

  🔍 Preview build  

7 files changed · ± 7 modified

± Modified

hugovk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Thank you, much clearer 👍

Comment thread Doc/library/difflib.rst Outdated
Comment thread Doc/library/difflib.rst Outdated
Comment thread Doc/library/difflib.rst
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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality
Suggested change
expected-case behavior dependent in a complicated way on how many elements
expected-case behavior dependent on a complicated way on how many elements

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I agree with Petr.

Comment thread Doc/library/difflib.rst
Comment on lines +124 to +126
because they synch up anywhere possible, sometimes at accidental matches
100 pages apart.
Restricting synch points to contiguous matches preserves some notion of

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

We use "sync" everywhere else, and avoids mispronunciation as "sinch" (which I have heard):

Suggested change
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

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

This PR just moves this text; I'd rather keep the original wording unchanged.
Merriam-Webster recognizes both sync & synch.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

And acknowledges "less commonly synch" :) But fine to keep it as is in this PR.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

There's no harm in keeping some of the page's old-timey charm :)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

A tossup.

Comment thread Doc/library/difflib.rst
Comment on lines +146 to +147
be ignored. Read the description of the
:meth:`~SequenceMatcher.find_longest_match` method's *isjunk*

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Perhaps? (and may need an escape)

Suggested change
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*

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Let's keep the original for now.

Comment thread Doc/library/difflib.rst Outdated
hugovk added needs backport to 3.13 only security fixes needs backport to 3.14 bugs and security fixes needs backport to 3.15 bugs and security fixes labels Jul 25, 2026

hugovk commented Jul 25, 2026

Copy link
Copy Markdown
Member

And let's backport (if trivial).

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>

encukou left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Thanks for proofreading!

Comment thread Doc/library/difflib.rst
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

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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.

Comment thread Doc/library/difflib.rst
Comment on lines +124 to +126
because they synch up anywhere possible, sometimes at accidental matches
100 pages apart.
Restricting synch points to contiguous matches preserves some notion of

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

This PR just moves this text; I'd rather keep the original wording unchanged.
Merriam-Webster recognizes both sync & synch.

Comment thread Doc/library/difflib.rst
Comment on lines +146 to +147
be ignored. Read the description of the
:meth:`~SequenceMatcher.find_longest_match` method's *isjunk*

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Let's keep the original for now.

hugovk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Thanks!

Comment thread Doc/library/difflib.rst
Comment on lines +124 to +126
because they synch up anywhere possible, sometimes at accidental matches
100 pages apart.
Restricting synch points to contiguous matches preserves some notion of

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

And acknowledges "less commonly synch" :) But fine to keep it as is in this PR.

encukou merged commit 1a40b7b into python:main Jul 28, 2026
33 checks passed
github-project-automation Bot moved this from Todo to Done in Docs PRs Jul 28, 2026

Copy link
Copy Markdown

Thanks @encukou for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14, 3.15.
🐍🍒⛏🤖

encukou deleted the difflib-doc branch July 28, 2026 09:04

bedevere-app Bot commented Jul 28, 2026

Copy link
Copy Markdown

GH-154805 is a backport of this pull request to the 3.15 branch.

bedevere-app Bot removed the needs backport to 3.15 bugs and security fixes label Jul 28, 2026

bedevere-app Bot commented Jul 28, 2026

Copy link
Copy Markdown

GH-154806 is a backport of this pull request to the 3.14 branch.

bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Jul 28, 2026

bedevere-app Bot commented Jul 28, 2026

Copy link
Copy Markdown

GH-154807 is a backport of this pull request to the 3.13 branch.

bedevere-app Bot removed the needs backport to 3.13 only security fixes label Jul 28, 2026
hugovk added a commit that referenced this pull request Jul 28, 2026
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
hugovk added a commit that referenced this pull request Jul 28, 2026
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
hugovk added a commit that referenced this pull request Jul 28, 2026
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
mbeijen pushed a commit to mbeijen/cpython that referenced this pull request Aug 14, 2026
- 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

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation in the Doc dir skip news

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL