Timsort in Cpython

alphonse23 at gmail.com alphonse23 at gmail.com
Sat Jun 15 17:43:16 EDT 2013


Ahh, that makes perfect sense. Thanks for clearing that up.

On Saturday, June 15, 2013 1:55:29 PM UTC-7, Robert Kern wrote:
> On 2013-06-15 21:21, alphonse23 at gmail.com wrote:
> 
> > Hey guys,
> 
> > Thanks for the quick reply! So why did they decide to call it listsort in the source instead? Why didn't they keep it as Timsort?
> 
> 
> 
> This was the first implementation of the algorithm. The algorithm was only 
> 
> colloquially named "Timsort" after it was used in Python.
> 
> 
> 
> This the naming convention for the C implementation of builtin types' methods in 
> 
> the Python codebase. The C implementation listsort() corresponds with the Python 
> 
> method list.sort(). Similarly, listappend() is list.append(), listpop() is 
> 
> list.pop(), etc. C.f.
> 
> 
> 
> http://hg.python.org/cpython/file/default/Objects/listobject.c#l2362
> 
> 
> 
> -- 
> 
> Robert Kern
> 
> 
> 
> "I have come to believe that the whole world is an enigma, a harmless enigma
> 
>   that is made terrible by our own mad attempt to interpret it as though it had
> 
>   an underlying truth."
> 
>    -- Umberto Eco




More information about the Python-list mailing list