[Python-Dev] Re: Why list.sort() uses mergesort and not timsort?

2021年6月06日 02:59:30 -0700

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?
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.
Christian
_______________________________________________
Python-Dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/[email protected]/message/P7XFRAU6GL2CH6RBXPLGXEK4AL5KF2HV/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to