2 ms·
> uses the fact that python datastructures are known length to figure out the best sorting method for the size. That... does not match with my knowledge of how
by morelisp 5y ago
> uses the fact that python datastructures are known length to figure out the best sorting method for the size.
That... does not match with my knowledge of how timsort works. The sorting method is chosen based on the array length, and every sorting algorithm in every language knows that. It's extremely suboptimal for some types because Python's typing is so weak!
Timsort succeeds because it has many good heuristics to optimize common properties of its merge intervals.