This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author eli.bendersky
Recipients eli.bendersky
Date 2008-12-10.17:20:53
SpamBayes Score 0.00045895166
Marked as misclassified No
Message-id <1228929654.94.0.843066747309.issue4622@psf.upfronthosting.co.za>
In-reply-to
Content
Here's a reproduction of the error:

Python 2.5.2 (r252:60911, Oct 20 2008, 09:11:31)
[GCC 3.4.6 20060404 (Red Hat 3.4.6-10)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import difflib
>>>
>>> difflib.SequenceMatcher(None, [4] + [5] * 200, [5] * 200).ratio()
0.0

ratio() should be returning close to 1.0 here, not 0. This is only a
problem for sequences longer than 200. The analogous run for 100:

>>> difflib.SequenceMatcher(None, [4] + [5] * 100, [5] * 100).ratio()
0.99502487562189057
>>>


I've managed to reproduce it on Linux, Windows (AS 2.5.2) and Try Python
(http://try-python.mired.org/)
History
Date User Action Args
2008-12-10 17:20:55eli.benderskysetrecipients: + eli.bendersky
2008-12-10 17:20:54eli.benderskysetmessageid: <1228929654.94.0.843066747309.issue4622@psf.upfronthosting.co.za>
2008-12-10 17:20:54eli.benderskylinkissue4622 messages
2008-12-10 17:20:53eli.benderskycreate