Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Marko Rauhamaa Newsgroups: comp.lang.python Subject: Re: 3 Suggestions to Make Python Easier For Children Date: Tue, 05 Aug 2014 16:19:48 +0300 Organization: A noiseless patient Spider Lines: 22 Message-ID: <87fvhbxedn.fsf@elektro.pacujo.net> References: <7ef67ccc-3fc3-47dd-b858-09ef3b57a497@googlegroups.com> <87k36nxhv8.fsf@elektro.pacujo.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: mx05.eternal-september.org; posting-host="ff5cf27ef3d5b31f034d3b72bdc27a41"; logging-data="23381"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18FoDn/Y5z2nsjgdPuujH9d" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) Cancel-Lock: sha1:Ub/bFAMizl1BeXl8JlzGMNZ+09s= sha1:YyjwYgINqC78gbCdWBsOqXcy4ys= Xref: csiph.com comp.lang.python:75738 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. Marko