Older versions of Python (2.3 - 3.10) used an algorithm called Timsort:
Timsort is a hybrid sorting algorithm, derived from merge sort and insertion sort, designed to perform well on many kinds of real-world data. It was invented by Tim Peters in 2002 for use in the Python programming language. The algorithm finds subsets of the data that are already ordered, and uses the subsets to sort the data more efficiently. This is done by merging an identified subset, called a run, with existing runs until certain criteria are fulfilled. Timsort was Python's standard sorting algorithm from version 2.3 to version 3.10. It is now also used to sort arrays in Java SE 7, and on the Android platform.
Since 3.11, Python uses Powersort, which was designed by Ian Munro and Sebastian Wild. It is an improved nearly-optimal mergesort that adapts to existing runs of sorted data.
Answer from bgporter on Stack Overflowsorting - What algorithm does python's sorted() use? - Stack Overflow
Is it always better to build your own sorting algorithms?
What sorting algorithm does python used for list.sort() ??
How does Python's sort() function work?
Videos
Older versions of Python (2.3 - 3.10) used an algorithm called Timsort:
Timsort is a hybrid sorting algorithm, derived from merge sort and insertion sort, designed to perform well on many kinds of real-world data. It was invented by Tim Peters in 2002 for use in the Python programming language. The algorithm finds subsets of the data that are already ordered, and uses the subsets to sort the data more efficiently. This is done by merging an identified subset, called a run, with existing runs until certain criteria are fulfilled. Timsort was Python's standard sorting algorithm from version 2.3 to version 3.10. It is now also used to sort arrays in Java SE 7, and on the Android platform.
Since 3.11, Python uses Powersort, which was designed by Ian Munro and Sebastian Wild. It is an improved nearly-optimal mergesort that adapts to existing runs of sorted data.
The sort algorithm is called Timsort. See timsort