Skip to content

Commit 1d9605e

Browse files
committed
remove all notes, keep only junk explanation at the top
1 parent 39e47c3 commit 1d9605e

1 file changed

Lines changed: 0 additions & 57 deletions

File tree

Doc/library/difflib.rst

Lines changed: 0 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -194,11 +194,6 @@ diffs. For comparing directories and files, see also, the :mod:`filecmp` module.
194194

195195
See :ref:`difflib-interface` for a more detailed example.
196196

197-
.. note::
198-
199-
This uses a :class:`SequenceMatcher` internally, so swapping *a* and
200-
*b* can produce different results.
201-
202197

203198
.. function:: get_close_matches(word, possibilities, n=3, cutoff=0.6)
204199

@@ -260,11 +255,6 @@ diffs. For comparing directories and files, see also, the :mod:`filecmp` module.
260255
+ tree
261256
+ emu
262257

263-
.. note::
264-
265-
This uses a :class:`SequenceMatcher` internally, so swapping *a* and
266-
*b* can produce different results.
267-
268258

269259
.. function:: restore(sequence, which)
270260

@@ -334,11 +324,6 @@ diffs. For comparing directories and files, see also, the :mod:`filecmp` module.
334324

335325
See :ref:`difflib-interface` for a more detailed example.
336326

337-
.. note::
338-
339-
This uses a :class:`SequenceMatcher` internally, so swapping *a* and
340-
*b* can produce different results.
341-
342327
.. versionchanged:: 3.15
343328
Added the *color* parameter.
344329

@@ -417,18 +402,6 @@ The :class:`SequenceMatcher` class has this constructor:
417402
of positions where they occur. All three are reset whenever *b* is reset
418403
with :meth:`set_seqs` or :meth:`set_seq2`.
419404

420-
.. note::
421-
422-
Both *isjunk* and the *autojunk* heuristic only consider *b* for filtering
423-
out items. Consequently, swapping *a* and *b* can change which items are treated
424-
as junk, which can in turn change the matching blocks found by
425-
:meth:`get_matching_blocks` and :meth:`get_opcodes`, the value returned by
426-
:meth:`ratio`, and the diffs produced by :func:`unified_diff`,
427-
:func:`context_diff`, and :func:`ndiff`, all of which build a
428-
:class:`SequenceMatcher` internally.
429-
A custom *isjunk* has this effect at any sequence length, and the automatic
430-
*autojunk* heuristic has the same effect for sequences of 200 or more items.
431-
432405
.. versionadded:: 3.2
433406
The *bjunk* and *bpopular* attributes.
434407

@@ -518,21 +491,6 @@ The :class:`SequenceMatcher` class has this constructor:
518491
>>> s.get_matching_blocks()
519492
[Match(a=0, b=0, size=2), Match(a=3, b=2, size=2), Match(a=5, b=4, size=0)]
520493

521-
.. note::
522-
523-
Caution: the result may depend on the order of the arguments. For
524-
instance::
525-
526-
>>> SequenceMatcher(None, 'tide', 'diet').get_matching_blocks()
527-
[Match(a=0, b=3, size=1), Match(a=4, b=4, size=0)]
528-
>>> SequenceMatcher(None, 'diet', 'tide').get_matching_blocks()
529-
[Match(a=0, b=2, size=1), Match(a=2, b=3, size=1), Match(a=4, b=4, size=0)]
530-
531-
This comes from the matching algorithm itself. Another cause for order
532-
causing different outputs, sometimes wildly, is the junk filtering
533-
heuristic (a custom *isjunk* at any sequence length, or the
534-
automatic *autojunk* heuristic for sequences of 200 or more
535-
items). See the :class:`SequenceMatcher` for details.
536494

537495
.. method:: get_opcodes()
538496

@@ -574,11 +532,6 @@ The :class:`SequenceMatcher` class has this constructor:
574532
equal a[4:6] --> b[3:5] 'cd' --> 'cd'
575533
insert a[6:6] --> b[5:6] '' --> 'f'
576534

577-
.. note::
578-
579-
This is derived from :meth:`get_matching_blocks`, and so shares
580-
its order-dependence; see the note there.
581-
582535

583536
.. method:: get_grouped_opcodes(n=3)
584537

@@ -590,11 +543,6 @@ The :class:`SequenceMatcher` class has this constructor:
590543

591544
The groups are returned in the same format as :meth:`get_opcodes`.
592545

593-
.. note::
594-
595-
This is derived from :meth:`get_matching_blocks`, and so shares
596-
its order-dependence; see the note there.
597-
598546

599547
.. method:: ratio()
600548

@@ -610,11 +558,6 @@ The :class:`SequenceMatcher` class has this constructor:
610558
to try :meth:`quick_ratio` or :meth:`real_quick_ratio` first to get an
611559
upper bound.
612560

613-
.. note::
614-
615-
This is derived from :meth:`get_matching_blocks`, and so shares
616-
its order-dependence; see the note there.
617-
618561

619562
.. method:: quick_ratio()
620563

0 commit comments

Comments
 (0)