Few things that might be useful to add:
str.rfinddoesn’t use two-way and is subject toO(n^2)worst case. This implements it, but uncertain when it is going to merged - not an issue in practice.difflib’s longest common substring implementation is worst caseO(n^2). I think this is the only algorithm instdlibfrom the family of sequence alignment (apart from private_suggestionsLevenstein DP score). Thought of replacing it withO(n)so to have a proper LCSUB that users can rely on (this has been brought up several times), but decided to wait until there is a dedicated place for sequence algorithms. Current implementation is good enough for thedifflib’s approach.list.sortis adaptive -O(n)best case. A lot of cases run faster thanO(nlogn).