Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #48460

Re: Timsort in Cpython

Newsgroups comp.lang.python
Date 2013-06-16 09:15 -0700
References <9ca984d5-19d9-4e82-a305-2a2f5ee341fe@googlegroups.com> <b3df2c76-b191-4cbb-9859-874b534a17e5@googlegroups.com> <tNivt.54379$Gm5.38341@fx11.am4>
Message-ID <0aa2bd06-d1ae-446b-9c85-917f43af4db2@googlegroups.com> (permalink)
Subject Re: Timsort in Cpython
From alphonse23@gmail.com

Show all headers | View raw


sorry about that. I'm new to google groups. I'm trying to make sense of python's implementation of timsort through cpython: http://hg.python.org/cpython/file/default/Objects/listobject.c

I was replying to Terry Jan Reedy
>
> http://hg.python.org/cpython/file/default/Objects/listsort.txt
> 
> is pretty clear (to me) for most of the basics.


> Though, if anyone would be interested in helping me out further -- though by all means, I'm not lazy, I can figure it myself. But, I wanted to pass in variables into listsort and watch timsort work line by line in gdb. 
> 
> listsort(PyListObject *self, PyObject *args, PyObject *kwds) 
> 
> I've never worked with Cpython source before, but it looks like PyObject is just some type of general strut.. I think anyway. How does python represent a list of ints in source? and what are the two second arguments for, assuming the first is the list strut. 
> 



On Sunday, June 16, 2013 6:08:50 AM UTC-7, mm0fmf wrote:
> Answer: The lost context.
> 
> 
> 
> Question: What makes top-posted replies harder to read than bottom-posted?
> 
> 
> 
> 
> 
> 
> 
> alphonse23@gmail.com wrote:
> 
> > Yes I've read it. Very interesting read. There are other resources too online that make it very clear, for instance the wikipedia articles is pretty good.
> 
> > 
> 
> > Though, if anyone would be interested in helping me out further -- though by all means, I'm not lazy, I can figure it myself. But, I wanted to pass in 
variables into listsort and watch timsort work line by line in gdb. 
> 
> > 
> 
> > listsort(PyListObject *self, PyObject *args, PyObject *kwds)
> 
> > 
> 
> > I've never worked with Cpython source before, but it looks like PyObject is just some type of general strut.. I think anyway. How does python represent a list of ints in source? and what are the two second arguments for, assuming the first is the list strut.
> 
> > 
> 
> > On Saturday, June 15, 2013 12:44:01 PM UTC-7, alpho...@gmail.com wrote:
> 
> >> I'm currently trying to make sense of Python's Timsort function. From the wikipedia page I was told the algorithm is located somewhere here: http://hg.python.org/cpython/file/default/Objects/listobject.c
> 
> >>
> 
> >>
> 
> >>
> 
> >> So of all the functions in there, could somebody point to me which one is timsort?
> 
> >>
> 
> >>
> 
> >>
> 
> >> Thanks, if anyone can help.
> 
> >>
> 
> >> Alphonse23

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Timsort in Cpython alphonse23@gmail.com - 2013-06-15 12:44 -0700
  Re: Timsort in Cpython Zachary Ware <zachary.ware+pylist@gmail.com> - 2013-06-15 14:55 -0500
  Re: Timsort in Cpython Robert Kern <robert.kern@gmail.com> - 2013-06-15 21:00 +0100
  Re: Timsort in Cpython alphonse23@gmail.com - 2013-06-15 13:21 -0700
    Re: Timsort in Cpython Robert Kern <robert.kern@gmail.com> - 2013-06-15 21:55 +0100
      Re: Timsort in Cpython alphonse23@gmail.com - 2013-06-15 14:43 -0700
    Re: Timsort in Cpython Terry Reedy <tjreedy@udel.edu> - 2013-06-15 22:56 -0400
  Re: Timsort in Cpython alphonse23@gmail.com - 2013-06-15 21:05 -0700
    Re: Timsort in Cpython mm0fmf <none@mailinator.com> - 2013-06-16 14:08 +0100
      Re: Timsort in Cpython alphonse23@gmail.com - 2013-06-16 09:15 -0700
        Re: Timsort in Cpython Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2013-06-16 16:16 -0400
          Re: Timsort in Cpython sean.westfall@gmail.com - 2013-06-19 10:10 -0700
    Re: Timsort in Cpython Ian Kelly <ian.g.kelly@gmail.com> - 2013-06-16 14:33 -0600
      Re: Timsort in Cpython sean.westfall@gmail.com - 2013-06-19 10:18 -0700
        Re: Timsort in Cpython Ian Kelly <ian.g.kelly@gmail.com> - 2013-06-19 12:20 -0600

csiph-web