Path: csiph.com!usenet.pasdenom.info!news.etla.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!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.027 X-Spam-Evidence: '*H*': 0.95; '*S*': 0.00; '(so': 0.07; 'explicit': 0.07; 'definition,': 0.09; 'identifier': 0.09; 'python': 0.11; '"."': 0.16; '::=': 0.16; 'attributeref': 0.16; 'expression.': 0.16; 'limit.': 0.16; 'normally,': 0.16; 'object),': 0.16; 'slicing,': 0.16; 'struck': 0.16; 'wrote:': 0.18; 'thoughts': 0.19; 'bruce': 0.22; 'header:User-Agent:1': 0.23; 'questions:': 0.24; 'primary': 0.26; 'defined': 0.27; 'header:In-Reply-To:1': 0.27; 'appear': 0.29; 'correct': 0.29; "doesn't": 0.30; "i'm": 0.30; 'that.': 0.31; 'another': 0.32; 'trouble': 0.34; "i'd": 0.34; 'beyond': 0.35; 'definition': 0.35; 'but': 0.35; 'method': 0.36; 'wrong': 0.37; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'little': 0.38; 'to:addr:python.org': 0.39; 'called': 0.40; 'skip:u 10': 0.60; 'course': 0.61; 'first': 0.61; 'happen': 0.63; 'side': 0.67; 'received:74.208': 0.68; 'online': 0.71; 'hand': 0.80; '5.3.1': 0.84; 'received:74.208.4.194': 0.84; 'dozen': 0.91; 'mean.': 0.91 Date: Wed, 17 Apr 2013 07:07:45 -0400 From: Dave Angel User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130308 Thunderbird/17.0.4 MIME-Version: 1.0 To: python-list@python.org Subject: Re: Atoms, Identifiers, and Primaries References: <66e78281-542b-41b3-a56d-04bf736d1e0a@googlegroups.com> In-Reply-To: <66e78281-542b-41b3-a56d-04bf736d1e0a@googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:9miytMGmlj3i6WNbZRBPT69nEZ87etLfMFA4sKBkRiF qbvBtX4kW63eUEAmvzyodruFrsgH61uEdBWKvy655Apbjq5SJQ OjRhC+56rTPHFdX1f6kqayCLMAqfm9j3YK+p2/DHb++YFUCob3 NTrMloTTuqhV3dzWSBn3ObAi8+ig8jfljTU8PoEnTPJ/hF55y0 W01NRpU8+335b0Jr05AyJFsHMsX/S+SXhqVTxR6Q8OKnOr6p9H LrQPYQ2jsoo4PYQOwQJtN51aFju8kPqM6+EEtjk9VMJXbIPHa4 c1OaQbu/duXEjRisn/HsdIsxfaXRL+eMn2rZqU+R6ycDrZ/OQ= = 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: 28 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1366196887 news.xs4all.nl 2683 [2001:888:2000:d::a6]:48200 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:43754 On 04/16/2013 10:57 PM, Bruce McGoveran wrote: > These are terms that appear in section 5 (Expressions) of the Python online documentation. I'm having some trouble understanding what, precisely, these terms mean. I'd appreciate the forum's thoughts on these questions: > > > 3. Section 5.3.1 offers this definition of an attributeref: > attributeref ::= primary "." identifier > > Now, I was at first a little concerned to see the non-terminal primary on the right hand side of the definition, since primary is defined to include attributeref in section 5.3 (so this struck me as circular). Am I correct in thinking attributeref is defined this way to allow for situations in which the primary, whether an atom, attributeref (example: an object on which a method is called that returns another object), subscription, slicing, or call, returns an object with property identifier? > It is circular. Nothing wrong with that. It means that not only can you use a.b but also a.b.c and a.b.c.d.e.f.g without any explicit limit. if a non-circular definition were to be attempted, you might need a few dozen rules, just to cover what someone *might* happen to use in an expression. Of course normally, one doesn't go much beyond a.b.c in a single expression. -- DaveA