Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed2.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.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'subject:not': 0.03; 'syntax': 0.04; 'attributes': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject:Why': 0.09; 'python': 0.11; 'dictionary.': 0.16; 'identifiers': 0.16; 'piotr': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'subject:accessing': 0.16; 'wrote:': 0.18; 'code.': 0.18; 'header :User-Agent:1': 0.23; 'header:X-Complaints-To:1': 0.27; 'header :In-Reply-To:1': 0.27; 'function': 0.29; 'dec': 0.30; 'too.': 0.31; 'subject:with': 0.35; 'there': 0.35; 'subject:?': 0.36; 'similar': 0.36; 'being': 0.38; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'is.': 0.60; 'subject:there': 0.68; 'subjectcharset:utf-8': 0.72; 'received:myvzw.com': 0.84; 'subject:being': 0.84; '2013': 0.98 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Dave Angel Subject: =?UTF-8?Q?Re:_Why_is_there_no_natural_syntax_for_accessing_a?= =?UTF-8?Q?ttributes_with_names=0A_not_being_valid_identifiers=3F?= Date: Tue, 03 Dec 2013 12:48:38 -0500 References: <15912943-29a1-4365-b027-7bb8cec447f8@googlegroups.com> <15912943-29a1-4365-b027-7bb8cec447f8@googlegroups.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Gmane-NNTP-Posting-Host: 181.sub-70-208-163.myvzw.com In-Reply-To: <15912943-29a1-4365-b027-7bb8cec447f8@googlegroups.com> User-Agent: Groundhog Newsreader for Android 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: 14 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1386092874 news.xs4all.nl 2837 [2001:888:2000:d::a6]:49503 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:60956 On Tue, 3 Dec 2013 09:14:49 -0800 (PST), Piotr Dobrogost wrote: > I find global getattr() function awkward when reading code. Me too. > What is the reason there's no "natural" syntax allowing to access attributes with names not being valid Python identifiers in a similar way to other attributes? There is. Just use a dictionary. -- DaveA