Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Ian Kelly Newsgroups: comp.lang.python Subject: Re: I'm wrong or Will we fix the ducks limp? Date: Fri, 3 Jun 2016 09:35:06 -0600 Lines: 31 Message-ID: References: <87mvn22veg.fsf@rudin.co.uk> <13108bea-6750-443b-bee8-0532aba8b338@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: news.uni-berlin.de aUQMH8e4tw/677Dfm/l3PQT8YH46hdbLD+3VPGfv42Hw== 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; 'method.': 0.05; 'append': 0.07; 'assignment': 0.07; 'correspond': 0.07; 'variable,': 0.07; 'confuse': 0.09; 'variables,': 0.09; 'received:209.85.218': 0.10; 'python': 0.10; 'interpreter': 0.15; '2016': 0.16; 'deque': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'statement.': 0.16; 'variable.': 0.16; 'wrote:': 0.16; 'case.': 0.18; 'refers': 0.18; 'variable': 0.18; 'issue.': 0.20; 'assign': 0.22; 'object.': 0.22; 'trying': 0.22; 'am,': 0.23; 'leave': 0.23; 'references': 0.23; 'written': 0.24; 'header:In-Reply-To:1': 0.24; "doesn't": 0.26; 'fri,': 0.27; 'message-id:@mail.gmail.com': 0.27; 'this.': 0.28; 'array': 0.29; 'objects': 0.29; 'creating': 0.30; "i'd": 0.31; 'supposed': 0.31; 'point': 0.33; 'class': 0.33; 'problem': 0.33; 'correctly': 0.34; 'list': 0.34; 'received:google.com': 0.35; 'could': 0.35; "isn't": 0.35; 'should': 0.36; 'there': 0.36; 'received:209.85': 0.36; 'to:addr:python-list': 0.36; 'subject:?': 0.36; 'subject:: ': 0.37; 'being': 0.37; 'method': 0.37; 'say': 0.37; 'doing': 0.38; 'received:209': 0.38; 'anything': 0.38; 'associate': 0.38; 'subject:the': 0.39; 'to:addr:python.org': 0.40; 'your': 0.60; 'more': 0.63; 'believe': 0.66; 'obvious': 0.76; 'catch?': 0.84; 'to:name:python': 0.84; 'try.': 0.91 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-transfer-encoding; bh=j14wLEoy2UBUokHfVfO5g5hgPs6o7fbZuGuA8usg1bA=; b=FOsnQ2ptD3/7GqWkCcZsdI+9w9BpAufz2De0mi06L5atXamO9ziYaf5LbxH4ACfu6J AQmumLpqLKJIu9jpjNzvywAE0dk2Xi/NM3am2FIXCANFHyRDZGskzeEI6b6yoGegDDPA dTG9Ru/DE7SZ8QTaxCrXBhStViIPUHZ1Cb2snv5sQScs0KJ5q+qQiRUsYlX0WKW8TG26 yDUuB0vPO7slMCENgFwOdXNiVtIa49HwxYi6I7jelHqMCcaiJyH7Z2WCkfh5xnRfFch0 FXq1KlCC3q2K64XZ841YTxAwrs1puVt1deHgQe9zzumrAUlAU/48z3hNbPGr3/US0fJO h2Dw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:content-transfer-encoding; bh=j14wLEoy2UBUokHfVfO5g5hgPs6o7fbZuGuA8usg1bA=; b=Bs6Mm+y9XJEgLNZDRpP/CgdZYRmt1f+Q+eBfKXTYQRG7tWh3+DEwrQUo81fVG+6BUf S/uLABnwB8MzwjUfkWzpBMYff9zMDO+0bi08BtkAdYrm4iGqT9QJVgROr6Q/5koKd/Wj IZYywLlHixBG81lTNqmiJRgDGTGH3J8gjNmVE1cqWhyQJxe4fGbyv+r2l6jAc5Y1vIUH 0MKzfLci+SsMFYBPT2vBrv2Pl6gs+s5rRqCJRw+F2tSVuoOb0CoSW8lpU3dkoARHwYsr ocs4CsnT9r4dO+SUlH1npXXp5qKwNAGHDssPqmjLvZJystwG0Vzv59vLMbfuuw9Pa5dz wqFQ== X-Gm-Message-State: ALyK8tLc/MIFEPIs4tGWzWGIj1BDDo6RYFjrNnYxDTYp1oRIvDrACr+eJn4c74YqkvFw4jAu1nfrMNWsHNMKGA== X-Received: by 10.157.40.57 with SMTP id m54mr2367390otb.152.1464968145466; Fri, 03 Jun 2016 08:35:45 -0700 (PDT) In-Reply-To: <13108bea-6750-443b-bee8-0532aba8b338@googlegroups.com> X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: X-Mailman-Original-References: <87mvn22veg.fsf@rudin.co.uk> <13108bea-6750-443b-bee8-0532aba8b338@googlegroups.com> Xref: csiph.com comp.lang.python:109421 On Fri, Jun 3, 2016 at 9:04 AM, Sayth Renshaw wrot= e: > > >> The problem is that you think that *variables* have a type. This isn't >> the case. Objects have a type. A variable is a name by which you can >> refer to an object. There are various ways in which you can associate a >> object with a variable, the most obvious being an assignment statement. > > So at the point I create the variable it refers to an object. > > More correctly when I create the variable and assign a list action to the= variable I believe I should be creating a reference to a list object in on= e motion; however python would like me to create the object first before cr= eating a reference to it, is that the catch? > > I am not allowed to create references to an object at the same time I cre= ate the object is that correct? I'd say leave references out of this. They don't correspond 1:1 with variables, and bringing them up is only going to confuse the issue. When you call the append method you're not "assigning a list action" to the variable. You're just trying to call a method named "append". That could be the list append method. Or it could be the array append method. Or the deque append method. Or you may have written your own class with an append method. How is the interpreter supposed to know which one you mean? In general, it can't, so it doesn't try. You have to create an object before you can start doing anything it.