Skip to content

[3.10] bpo-45216: Remove extraneous method docs from difflib (GH-28445) #28505

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 0 additions & 40 deletions Lib/difflib.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,38 +115,6 @@ class SequenceMatcher:
case. SequenceMatcher is quadratic time for the worst case and has
expected-case behavior dependent in a complicated way on how many
elements the sequences have in common; best case time is linear.

Methods:

__init__(isjunk=None, a='', b='')
Construct a SequenceMatcher.

set_seqs(a, b)
Set the two sequences to be compared.

set_seq1(a)
Set the first sequence to be compared.

set_seq2(b)
Set the second sequence to be compared.

find_longest_match(alo=0, ahi=None, blo=0, bhi=None)
Find longest matching block in a[alo:ahi] and b[blo:bhi].

get_matching_blocks()
Return list of triples describing matching subsequences.

get_opcodes()
Return list of 5-tuples describing how to turn a into b.

ratio()
Return a measure of the sequences' similarity (float in [0,1]).

quick_ratio()
Return an upper bound on .ratio() relatively quickly.

real_quick_ratio()
Return an upper bound on ratio() very quickly.
"""

def __init__(self, isjunk=None, a='', b='', autojunk=True):
Expand Down Expand Up @@ -837,14 +805,6 @@ class Differ:
+ 4. Complicated is better than complex.
? ++++ ^ ^
+ 5. Flat is better than nested.

Methods:

__init__(linejunk=None, charjunk=None)
Construct a text differencer, with optional filters.

compare(a, b)
Compare two sequences of lines; generate the resulting delta.
"""

def __init__(self, linejunk=None, charjunk=None):
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Remove extra documentation listing methods in ``difflib``. It was rendering
twice in pydoc and was outdated in some places.