There are two different distances called Damerau-Levenshtein (see the Wikipedia page, for example), one is the restricted distance and the other is the original one, the unrestricted distance. The damerau_levenshtein function in pylev calculates the restricted distance (so the distance between "CA" and "ABC" is 3, not 2). It would be good for this to be made clear in the documentation.
Thanks!