Taking the example code from the help for Levenshtein.apply_edit:
from Levenshtein import *
e = editops('man', 'scotsman')
apply_edit(e, 'man', 'scotsman')
apply_edit(e[:3], 'man', 'scotsman')
This works fine on Python 2.7.6:
Python 2.7.6 (default, Nov 26 2013, 12:52:49)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from Levenshtein import *
>>> e = editops('man', 'scotsman')
>>> apply_edit(e, 'man', 'scotsman')
'scotsman'
>>> apply_edit(e[:3], 'man', 'scotsman')
'scoman'
However, it gives an error on Python 3.3.3:
Python 3.3.3 (default, Nov 26 2013, 13:33:18)
[GCC 4.8.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from Levenshtein import *
>>> e = editops('man', 'scotsman')
>>> apply_edit(e, 'man', 'scotsman')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: apply_edit first argument must be a List of edit operations
>>> apply_edit(e[:3], 'man', 'scotsman')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: apply_edit first argument must be a List of edit operations
Taking the example code from the help for Levenshtein.apply_edit:
This works fine on Python 2.7.6:
However, it gives an error on Python 3.3.3:
http://www.python-forum.de/viewtopic.php?f=1&t=32969 seems to indicate the same.