Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed3.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.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'subject:not': 0.03; 'syntax': 0.04; 'wednesday,': 0.07; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'statements': 0.09; 'subject:Why': 0.09; 'python': 0.11; "'-'": 0.16; '>on': 0.16; '>to': 0.16; 'all?': 0.16; 'assignment?': 0.16; 'attributes.': 0.16; 'message- id:@4ax.com': 0.16; 'ought': 0.16; 'piotr': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'stop?': 0.16; 'subject:accessing': 0.16; 'wrote:': 0.18; 'slightly': 0.19; 'preferred': 0.22; 'url:home': 0.24; 'second': 0.26; 'header:X-Complaints-To:1': 0.27; 'tim': 0.29; 'dec': 0.30; 'concise': 0.31; 'problem': 0.35; 'subject:with': 0.35; 'december': 0.35; 'there': 0.35; 'charset:us-ascii': 0.36; 'subject:?': 0.36; 'two': 0.37; 'being': 0.38; 'received:76': 0.38; 'to:addr:python-list': 0.38; 'does': 0.39; 'to:addr:python.org': 0.39; 'enough': 0.39; 'received:org': 0.40; 'new': 0.61; 'more': 0.64; 'subject:there': 0.68; 'savings': 0.81; 'subject:being': 0.84; 'rusi': 0.91; '2013': 0.98 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Dennis Lee Bieber Subject: Re: Why is there no natural syntax for accessing attributes with names not being valid identifiers? Date: Wed, 04 Dec 2013 19:27:43 -0500 Organization: IISS Elusive Unicorn References: <15912943-29a1-4365-b027-7bb8cec447f8@googlegroups.com> <17gt99hg615jfm7bdid26185884d2pfdkf@4ax.com> <080d6a56-588b-425f-8968-8f77bc330427@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: adsl-76-249-27-178.dsl.klmzmi.sbcglobal.net X-Newsreader: Forte Agent 6.00/32.1186 X-No-Archive: YES 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: 35 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1386203271 news.xs4all.nl 2896 [2001:888:2000:d::a6]:44679 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:61063 On Tue, 3 Dec 2013 22:31:44 -0800 (PST), rusi declaimed the following: >On Wednesday, December 4, 2013 11:15:05 AM UTC+5:30, Tim Roberts wrote: >> Piotr Dobrogost wrote: >> > >> >Attribute access syntax being very concise is very often preferred >> >to dict's interface. >> >> It is not "very concise". It is slightly more concise. >> >> x = obj.value1 >> x = dct['value1'] >> >> You have saved 3 keystrokes. That is not a significant enough savings to >> create new syntax. Remember the Python philosophy that there ought to be >> one way to do it. > >Its a more fundamental problem than that: >It emerges from the OP's second post) that he wants '-' in the attributes. >Is that all? > >Where does this syntax-enlargement stop? Spaces? Newlines? Spaces? I present to you two FORTRAN statements DO 10 I = 3 . 14159 and DO10I = 3 , 1 4 1 5 9 Which is the loop and which is the assignment? -- Wulfraed Dennis Lee Bieber AF6VN wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/