Commit e9cbcd00 authored by sweeneyde's avatar sweeneyde Committed by Miss Islington (bot)

bpo-37004: Documented asymmetry of string arguments in difflib.SequenceMatcher...

bpo-37004: Documented asymmetry of string arguments in difflib.SequenceMatcher for ratio method (GH-13482)



https://bugs.python.org/issue37004
parent 610a4823
......@@ -543,6 +543,16 @@ The :class:`SequenceMatcher` class has this constructor:
to try :meth:`quick_ratio` or :meth:`real_quick_ratio` first to get an
upper bound.
.. note::
Caution: The result of a :meth:`ratio` call may depend on the order of
the arguments. For instance::
>>> SequenceMatcher(None, 'tide', 'diet').ratio()
0.25
>>> SequenceMatcher(None, 'diet', 'tide').ratio()
0.5
.. method:: quick_ratio()
......
In the documentation for difflib, a note was added explicitly warning that the results of SequenceMatcher's ratio method may depend on the order of the input strings.
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment