MCPcopy Index your code
hub / github.com/RustPython/RustPython / real_quick_ratio

Method real_quick_ratio

Lib/difflib.py:651–661  ·  view source on GitHub ↗

Return an upper bound on ratio() very quickly. This isn't defined beyond that it is an upper bound on .ratio(), and is faster to compute than either .ratio() or .quick_ratio().

(self)

Source from the content-addressed store, hash-verified

649 return _calculate_ratio(matches, len(self.a) + len(self.b))
650
651 def real_quick_ratio(self):
652 """Return an upper bound on ratio() very quickly.
653
654 This isn't defined beyond that it is an upper bound on .ratio(), and
655 is faster to compute than either .ratio() or .quick_ratio().
656 """
657
658 la, lb = len(self.a), len(self.b)
659 # can't have more matches than the number of elements in the
660 # shorter sequence
661 return _calculate_ratio(min(la, lb), la + lb)
662
663 __class_getitem__ = classmethod(GenericAlias)
664

Callers 2

get_close_matchesFunction · 0.95

Calls 3

lenFunction · 0.85
_calculate_ratioFunction · 0.85
minFunction · 0.85

Tested by 1