
On Sun, 6 Jun 2021 at 11:57, Christian Heimes christian@python.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 :)
Christian
Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-leave@python.org https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://mail.python.org/archives/list/python-dev@python.org/message/P7XFRAU6... Code of Conduct: http://python.org/psf/codeofconduct/