from random import randint

s1 = ''
s2 = ''

for i in xrange(1000):
    s1 += chr(randint(97,122))
    s2 += chr(randint(97,122))

print s1[:25]
print s2[:25]

import difflib

s = difflib.SequenceMatcher(None, s1, s2)

print s.find_longest_match(0, len(s1), 0, len(s2))



>>> ============== RESTART ====================
>>>
yymgzldocfaafcborxbpqyade
urvwtnkwfmcduybjqmrleflqx
(0, 0, 0)
>>>

I think it's line #314 in difflib "who's to blame" --
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to