Python difflib with parts reimplemented in C