Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!rt.uk.eu.org!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.015 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'subject:not': 0.03; 'attribute': 0.07; 'wednesday,': 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; 'wed,': 0.18; 'meant': 0.20; '>>>': 0.22; 'string,': 0.24; 'second': 0.26; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; 'dec': 0.30; 'message-id:@mail.gmail.com': 0.30; '"",': 0.31; 'file': 0.32; '(most': 0.33; 'comment': 0.34; 'problem': 0.35; 'subject:with': 0.35; 'december': 0.35; 'point.': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'subject:?': 0.36; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'recent': 0.39; 'does': 0.39; 'sure': 0.39; 'to:addr:python.org': 0.39; 'ian': 0.60; '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=wOsuSycha9Nf58fOLaeXqk0BSQqQMOggvjtMCdlotCE=; b=QFAzz1j8/ujlcL47yfywBYjNzFz3c4aIzsXnt5PGMTWUyZ1ivg+FBC4rYSKF6dCrPZ vEy36MggOqK/lpW33UMKORylEE8hbjX7mK2/LBpHgeEKReqMIILvgN9OyaO9P9nysTjl Zv8UcUp6mDrBgB+zbEabO0c1ivWVWaBYGSBxtmSUd41xftGZs1lQdpsCTluKrraSRgz8 sldwKaHhQ5x55ZF5spxeULi+MaLJ55C/mQi+VSx8Ok5hoEHV8A1VvbMebUV3tp3J6j6k kZAm0zvUf54820oAAhno16BrqWFuZwRhHk2tXA/QaOGP1Rl4dl15jQ6wna07Ub5t/6uA vh5w== X-Received: by 10.68.129.201 with SMTP id ny9mr49922238pbb.70.1386211472013; Wed, 04 Dec 2013 18:44:32 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <549180f1-fb98-4b59-b92f-5beceb1a6fb5@googlegroups.com> References: <15912943-29a1-4365-b027-7bb8cec447f8@googlegroups.com> <17gt99hg615jfm7bdid26185884d2pfdkf@4ax.com> <080d6a56-588b-425f-8968-8f77bc330427@googlegroups.com> <549180f1-fb98-4b59-b92f-5beceb1a6fb5@googlegroups.com> From: Ian Kelly Date: Wed, 4 Dec 2013 19:43:49 -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: 19 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1386211480 news.xs4all.nl 2877 [2001:888:2000:d::a6]:43256 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:61070 On Wed, Dec 4, 2013 at 3:09 AM, rusi wrote: > On Wednesday, December 4, 2013 2:27:28 PM UTC+5:30, Ian wrote: >> 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' > > Not sure what's your point. There was no point. My comment was only meant to be amusing.