Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news.stack.nl!newsfeed.xs4all.nl!newsfeed2a.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.006 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'python,': 0.02; 'subject:Python': 0.06; 'attribute': 0.07; 'attributes': 0.09; 'feature.': 0.09; 'key.': 0.09; 'before.': 0.16; 'from:addr:mrabarnett.plus.com': 0.16; 'from:addr:python': 0.16; 'from:name:mrab': 0.16; 'keys.': 0.16; 'message- id:@mrabarnett.plus.com': 0.16; 'mildly': 0.16; 'pause': 0.16; 'received:192.168.1.4': 0.16; 'index': 0.16; 'wrote:': 0.18; '>>>': 0.22; 'aug': 0.22; 'proposed': 0.22; 'header:User-Agent:1': 0.23; 'skip': 0.24; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; 'wonder': 0.29; "i'm": 0.30; '(which': 0.31; 'anywhere': 0.35; 'objects': 0.35; 'should': 0.36; 'to:addr:python-list': 0.38; 'short': 0.38; 'sure': 0.39; 'to:addr:python.org': 0.39; 'no.': 0.61; 'name': 0.63; 'refer': 0.63; 'between': 0.67; 'subject:For': 0.78; 'confusing': 0.84; 'dict.': 0.84; 'inherent': 0.84; 'contents.': 0.91; 'subject:Make': 0.91 X-CM-Score: 0.00 X-CNFS-Analysis: v=2.1 cv=R+ONGLhX c=1 sm=1 tr=0 a=0nF1XD0wxitMEM03M9B4ZQ==:117 a=0nF1XD0wxitMEM03M9B4ZQ==:17 a=0Bzu9jTXAAAA:8 a=u9EReRu7m0cA:10 a=2NIQW6GDGhgA:10 a=Pv7RHVLq6r0A:10 a=ihvODaAuJD4A:10 a=IkcTkHD0fZMA:10 a=EBOSESyhAAAA:8 a=ybZZDoGAAAAA:8 a=KaybevnVAAAA:8 a=RJL75FrmY15f6gp7GQMA:9 a=QEXdDO2ut3YA:10 a=qIVjreYYsbEA:10 a=X5q3X6-Q1Y0A:10 X-AUTH: mrabarnett:2500 Date: Tue, 05 Aug 2014 15:11:29 +0100 From: MRAB User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: python-list@python.org Subject: Re: 3 Suggestions to Make Python Easier For Children References: <7ef67ccc-3fc3-47dd-b858-09ef3b57a497@googlegroups.com> <87k36nxhv8.fsf@elektro.pacujo.net> <87fvhbxedn.fsf@elektro.pacujo.net> In-Reply-To: <87fvhbxedn.fsf@elektro.pacujo.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 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: 23 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1407247901 news.xs4all.nl 2969 [2001:888:2000:d::a6]:47298 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:75741 On 2014-08-05 14:19, Marko Rauhamaa wrote: > Skip Montanaro : > >> On Tue, Aug 5, 2014 at 7:04 AM, Marko Rauhamaa wrote: >>> I wonder if that should be built into dict. >> >> Short answer, no. I'm sure it's been proposed before. Attributes ≠ >> keys. When you see something.somethingelse anywhere else in Python, >> "somethingelse" is an attribute reference. When you see >> something[somethingelse], "somethingelse" is an index value or key. >> Why destroy that symmetry in dictionaries? > > I'm not sure I fully appreciate the dichotomy (which you euphemistically > refer to as symmetry). > >> JavaScript objects have that feature. I find it mildly confusing >> because whenever I see it I have to pause to consider whether the name >> I am looking at is an attribute or a key. > > What's the inherent difference between an attribute and a key. > An attribute is part of a container; a key is part of its contents.