On Sun, 6 Jun 2021 at 11:57, Christian Heimes firstname.lastname@example.org wrote:
On 06/06/2021 11.42, Marco Sulla wrote:
As title. Is it faster for inplace sorting, or simply the implementation of list.sort() was done before the implementation of timsort?
list.sort() uses timsort. What makes you think that Python uses mergesort?
In listobject.c, in the comment above list_sort_impl, there's written "An adaptive, stable, natural mergesort". But now I see that after there is "See listsort.txt" where it's stated "This describes an adaptive, stable, natural mergesort, modestly called timsort".
Tim Peters invented timsort for Python about twenty years ago. Tim a first generation Python core dev. Other languages like Java adopted timsort from Python later.
I know. Thank you for the answer :)
Python-Dev mailing list -- email@example.com To unsubscribe send an email to firstname.lastname@example.org https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://email@example.com/message/P7XFRAU6... Code of Conduct: http://python.org/psf/codeofconduct/