Terry J. Reedy added the comment:

'difflib' is a module that defines three classes and some functions. It does 
not do anything in itself. SequenceMatcher, which is the basis for the other 
functions, operates on sequences of hashable objects. The inputs must be 
concrete random access indexed sequences because SequenceMatcher scans the 
inputs and then jumps around finding good matches and the complementary 
differences. It is completely unlike functions that take iterables as arguments 
and than call iter to get an iterator. If S-M took iterables as inputs, it 
would have to either copy all inputs with list (bad) or figure out whether or 
not to copy. I think users can continue to pass file.readlines() or 
list(iterable) as needed.

The two functions that mistakenly say inputs are 'lists' instead of 'sequences' 
will be fixed at part of another issue.

----------
nosy: +terry.reedy
resolution:  -> works for me
status: open -> closed

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue8905>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to