Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!xlned.com!feeder7.xlned.com!newsfeed.xs4all.nl!newsfeed4.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.025 X-Spam-Evidence: '*H*': 0.95; '*S*': 0.00; 'subject:not': 0.03; 'attribute': 0.07; 'subject:Why': 0.09; "'-'": 0.16; 'all?': 0.16; 'attributes.': 0.16; 'stop?': 0.16; 'subject: \n ': 0.16; 'subject:accessing': 0.16; 'typeerror:': 0.16; 'wrote:': 0.18; '>>>': 0.22; 'string,': 0.24; 'second': 0.26; 'header:In-Reply- To:1': 0.27; 'dec': 0.30; 'message-id:@mail.gmail.com': 0.30; '"",': 0.31; 'file': 0.32; '(most': 0.33; 'problem': 0.35; 'subject:with': 0.35; 'received:google.com': 0.35; 'subject:?': 0.36; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'recent': 0.39; 'does': 0.39; 'to:addr:python.org': 0.39; 'name': 0.63; 'more': 0.64; 'subject:there': 0.68; 'subject:being': 0.84; 'rusi': 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:from:date:message-id:subject:to :content-type; bh=/0EY5EXultyLvhX1PquUINYTmWlIM88VlzxuXn4poRw=; b=DtPkoXmYA9k3moMkvIALv7H/M1qBtymnUMO/e9P5/F09aUzqbDgoU7Fm/zBihk18q+ l9JTQQ0wcLazp/mQJ493IGgeYSUxo4vZVkyqlBp9WLoUhodh3I52BKeyGJ6sj2wUEssT ZX2JFNzmt4p9xBMXcmK+6GK5B5NmnzuKy7QUg/aX2AFqa4kiTXWzO/vvm9/pRHLKDaRg gG50hV5K3AB5wzFmSOO+ixyBDtB2O2kaEaNk0GPdX0OuFOdLhYM2CQ2vMCMTeFR8rEwW VypdQh1sMUsPd5lb2Y7vuP5I2GJZx6kZLnzd6gycPYIBjyTyDKcLCL0mhiBgTml5qauD l1gw== X-Received: by 10.68.112.161 with SMTP id ir1mr44600311pbb.9.1386147488687; Wed, 04 Dec 2013 00:58:08 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <080d6a56-588b-425f-8968-8f77bc330427@googlegroups.com> References: <15912943-29a1-4365-b027-7bb8cec447f8@googlegroups.com> <17gt99hg615jfm7bdid26185884d2pfdkf@4ax.com> <080d6a56-588b-425f-8968-8f77bc330427@googlegroups.com> From: Ian Kelly Date: Wed, 4 Dec 2013 01:57:28 -0700 Subject: Re: Why is there no natural syntax for accessing attributes with names not being valid identifiers? To: Python 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: 13 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1386147492 news.xs4all.nl 2834 [2001:888:2000:d::a6]:38958 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:60992 On Tue, Dec 3, 2013 at 11:31 PM, rusi wrote: > 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? At non-strings. >>> setattr(foo, 21+21, 42) Traceback (most recent call last): File "", line 1, in TypeError: attribute name must be string, not 'int'