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: 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: References: <9ca984d5-19d9-4e82-a305-2a2f5ee341fe@googlegroups.com> From: Ian Kelly Date: Sun, 16 Jun 2013 14:33:17 -0600 Subject: Re: Timsort in Cpython To: Python 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: 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 On Sat, Jun 15, 2013 at 10:05 PM, wrote: > Yes I've read it. Very interesting read. There are other resources too on= line 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 repres= ent a list of ints in source? and what are the two second arguments for, as= suming 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.