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


Groups > comp.lang.python > #48480

Re: Timsort in Cpython

Path csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <ian.g.kelly@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.001
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'read.': 0.03; 'anyway.': 0.05; 'argument': 0.05; 'cpython': 0.05; 'args': 0.07; 'method.': 0.07; 'variables': 0.07; '*args,': 0.09; 'arguments': 0.09; 'assuming': 0.09; 'means,': 0.09; 'python': 0.11; 'def': 0.12; '**kwds):': 0.16; '10:05': 0.16; 'corresponds': 0.16; 'dict': 0.16; 'for,': 0.16; 'positional': 0.16; 'subtype': 0.16; 'tuple': 0.16; 'sat,': 0.16; 'wrote:': 0.18; 'looks': 0.24; "i've": 0.25; 'source': 0.25; '15,': 0.26; 'references': 0.26; 'second': 0.26; 'pass': 0.26; 'header:In-Reply-To:1': 0.27; 'function': 0.29; 'specifically': 0.29; 'generally': 0.29; 'message- id:@mail.gmail.com': 0.30; "i'm": 0.30; 'object.': 0.31; 'anyone': 0.31; 'figure': 0.32; 'worked': 0.33; 'third': 0.33; 'good.': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'keyword': 0.36; 'too': 0.37; 'two': 0.37; 'list': 0.37; 'list.': 0.37; 'represent': 0.38; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'does': 0.39; 'though,': 0.39; 'to:addr:python.org': 0.39; 'how': 0.40; 'read': 0.60; 'further': 0.61; 'first': 0.61; 'more': 0.64; 'articles': 0.65; 'yes': 0.68; 'containing': 0.69; 'helping': 0.70; 'online': 0.71; 'operated': 0.74; 'source?': 0.84; '2013': 0.98
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; bh=6cH3mONYxXQRQ6EFPmIFfdnmpW4wyOjSu7hYa6kPT0s=; b=lef2tY6RmO6DeqkqRaK/Onl6KqdF7fp8bwoGkW+4NC3OB13HDZ86QAFOd3EaDKdBsl adCpGhFmyk9AS3hiKE1h6CheAveV2RNIIr4/ZFuPTGQZDxF4Lenz5hqSIuWwo5lbyZgB z6piVA8Bp9NNzVN5gjdggxpchHsKuE5RTKoL+ODMhazVI8teAQYs9B2La8HiG1IEMuBA +Cd5xTw44QRq4VyBBh63kO3cmnINLPfYkIXVL1x5XDHJ1nAP7aO9aza7kXl81RgGp9eD W5kgs++fAkKkkVoFwuMa+1cZbEZWZtHGMZyL3W8m25wBJnXafdUZh6xtfZFB3MsJH5Xk c4SQ==
X-Received by 10.66.122.39 with SMTP id lp7mr10129632pab.208.1371414837199; Sun, 16 Jun 2013 13:33:57 -0700 (PDT)
MIME-Version 1.0
In-Reply-To <b3df2c76-b191-4cbb-9859-874b534a17e5@googlegroups.com>
References <9ca984d5-19d9-4e82-a305-2a2f5ee341fe@googlegroups.com> <b3df2c76-b191-4cbb-9859-874b534a17e5@googlegroups.com>
From Ian Kelly <ian.g.kelly@gmail.com>
Date Sun, 16 Jun 2013 14:33:17 -0600
Subject Re: Timsort in Cpython
To Python <python-list@python.org>
Content-Type text/plain; charset=ISO-8859-1
Content-Transfer-Encoding quoted-printable
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.3459.1371415158.3114.python-list@python.org> (permalink)
Lines 27
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1371415158 news.xs4all.nl 15883 [2001:888:2000:d::a6]:52325
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:48480

Show key headers only | View raw


On Sat, Jun 15, 2013 at 10:05 PM,  <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.

A PyObject* generally references any Python object.  The subtype
PyListObject* more specifically references a Python list.  The above
signature corresponds to this Python function signature:

    def listsort(self, *args, **kwds):

The first argument self is the list object to be operated on.  The
second argument args is a Python tuple containing any other positional
arguments that were passed into the method.  The third argument kwds
is a Python dict containing any keyword arguments that were passed
into the method.

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