Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!newsreader4.netcologne.de!news.netcologne.de!xlned.com!feeder7.xlned.com!news2.euro.net!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.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'python.': 0.02; 'attribute': 0.07; 'bootstrap': 0.07; 'attributes': 0.09; 'differently.': 0.09; 'latter': 0.09; 'literal': 0.09; 'referenced': 0.09; 'used.': 0.09; 'language,': 0.12; "wouldn't": 0.14; '"."': 0.16; '"["': 0.16; 'expression,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'literal.': 0.16; 'literals': 0.16; 'operation,': 0.16; 'operators,': 0.16; 'slice,': 0.16; 'wrote:': 0.18; 'wed,': 0.18; 'starts': 0.20; 'seems': 0.21; '>>>': 0.22; 'example': 0.22; 'specify': 0.24; 'somewhere': 0.26; 'header:In-Reply-To:1': 0.27; 'chris': 0.29; 'am,': 0.29; 'message-id:@mail.gmail.com': 0.30; 'container': 0.31; 'context.': 0.31; 'object.': 0.31; 'there.': 0.32; 'probably': 0.32; 'another': 0.32; 'quite': 0.32; 'url:python': 0.33; 'could': 0.34; "can't": 0.35; 'received:209.85': 0.35; 'received:209.85.220': 0.35; 'objects': 0.35; 'point.': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'really': 0.36; '(we': 0.36; 'object,': 0.36; 'url:org': 0.36; 'changing': 0.37; 'two': 0.37; 'received:209': 0.37; 'being': 0.38; 'whatever': 0.38; 'to:addr:python-list': 0.38; 'fact': 0.38; 'pm,': 0.38; 'to:addr:python.org': 0.39; 'either': 0.39; 'dave': 0.60; 'url:3': 0.61; 'name': 0.63; 'temporary': 0.65; 'acts': 0.74; 'operated': 0.74; 'of*': 0.84; 'subject:gets': 0.84; 'url:reference': 0.84; 'angel': 0.91; '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:date:message-id:subject:from:to :content-type; bh=vo8g9IFewPbHlYtvEeIbhfbTCgJb2wsKP9izQLtkL28=; b=IZerspQDCIQGjfkpSjn1wORYOr5KlXLIyn978nllNAIjkGOm99SqEY0HyxiEjZK1IC vasWHindzPaPj/+CYf+CXbsciOIEd3DzXRsLc0gezZOCzMGvPEnaYa266ybLNxlyaifW ALbTgngUz4u1RHHRVQ/SZopUYYUBHCFFasuHyq3MvSNgfYBlBpy6BVrYbogSvqA4SL9q J2wqsQpWfgu1iq/DDfHVrpLJT8iRGyRPfAemtsfc06/xooTr7Zhxeu3COF4RRWoU6CQp Rw1Y2PDdnF0N5N0H6nlorYgrEbqSuHnJCR0aARvk9NSpHbysh/s4upAZVEckAU/JWOJu F0Fg== MIME-Version: 1.0 X-Received: by 10.52.163.165 with SMTP id yj5mr472930vdb.104.1371630100279; Wed, 19 Jun 2013 01:21:40 -0700 (PDT) In-Reply-To: <51C1666F.6050307@davea.name> References: <51ba6e92$0$29997$c3e8da3$5496439d@news.astraweb.com> <51C144AA.5060008@davea.name> <51C1666F.6050307@davea.name> Date: Wed, 19 Jun 2013 18:21:40 +1000 Subject: Re: A certainl part of an if() structure never gets executed. From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 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: 51 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1371630102 news.xs4all.nl 15902 [2001:888:2000:d::a6]:51386 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:48698 On Wed, Jun 19, 2013 at 6:06 PM, Dave Angel wrote: > On 06/19/2013 03:14 AM, Chris Angelico wrote: >> >> On Wed, Jun 19, 2013 at 3:42 PM, Dave Angel wrote: >>> >>> Names are *one of* the ways we specify which objects are to be used. (We >>> can >>> also specify objects via an container and a subscript or slice, or via an >>> attribute of another object. And probably another way or two.) >> >> >> But you always have to bootstrap it with either a name. > > > Whatever bootstrap really means in this context. But if you have myname[3] > + myname[5], the two objects being added are identified by a subscript > operation, not just a name. > >> Or a literal. > > > A literal is used to create an object, and acts like a temporary name for > that object, but once again the object being operated on isn't necessarily > that one. You can subscript and get attributes from a literal as well. > > >> So those are the only two ways to specify which objects are to be >> used. >> > > That would be a pretty weak language, and it wouldn't be python. > > > Now if you considered "." and "[" as operators, then I could understand your > point. But > http://docs.python.org/3/reference/lexical_analysis.html#operators > seems to say differently. > > Also see > http://docs.python.org/3/reference/expressions.html#primaries They may not quite be "operators" per se, but the fact is that they're composites built of primitives. You can't reference an object without somewhere having either a name or a literal to start it off. Your example starts with the object identified by the name 'myname', and the objects referenced by the literals 3 and 5, and builds up from there. Rebinding 'myname' would change that expression, as would changing the meanings of 3 or 5, though I don't know of any way to do the latter :) ChrisA