Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.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.008 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'operator': 0.03; 'subject:Python': 0.06; 'abstraction': 0.09; 'explanation': 0.09; 'literal': 0.09; 'subject:()': 0.09; 'python': 0.11; 'itself.': 0.14; 'random': 0.14; '(sorry,': 0.16; '12:57': 0.16; 'dict': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'ought': 0.16; 'said.': 0.16; 'wrote:': 0.18; 'bit': 0.19; 'normally': 0.19; 'meant': 0.20; 'lets': 0.24; 'fine': 0.24; 'right.': 0.26; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; 'topic': 0.29; "doesn't": 0.30; 'sets': 0.30; 'message- id:@mail.gmail.com': 0.30; "d'aprano": 0.31; 'steven': 0.31; 'another': 0.32; 'fri,': 0.33; 'comment': 0.34; 'agree': 0.35; 'equal': 0.35; 'good.': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'similar': 0.36; 'should': 0.36; 'to:addr:python-list': 0.38; 'that,': 0.38; 'to:addr:python.org': 0.39; 'how': 0.40; 'expression': 0.60; 'real': 0.63; 'become': 0.64; 'more': 0.64; 'love': 0.65; 'side': 0.67; '26,': 0.68; 'subject: & ': 0.68; 'union': 0.69; 'jul': 0.74; 'leak': 0.84; '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:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=3eg4Bkdf2DgeNOp2JSn/x/pSt7nL3ke9zgsik2wlYbs=; b=u8CnJHUfVL7VHPhpId5/XxjKPqHbXJjwQnDBmSI00F98xCpgTkShFNB95GpjXjWftF ju7eTBviUaut6QKH+b1++glvOViO1UDztoXxJAk5Ewp7zUJfY/7qqwlLYD+vvne58RG3 /gXojKxwg8Sh2o4IzqlRlFptCAmyOC5k+i2uQdg0mWPYOWftTnqT1h1D4/CBgTrud6SF a7vsYf3HGZNLEWLB3PrZv5euJfb11MMLk1WKmFhZWG83OExJoeykeabPapwi6TfT9cGh 4K1oUEZUqI/+kAZAWRBXpwJUGo7j9lW1Q0wX/hxTyTeH0nBc+ODSiyh3oWZp+bodINL6 bKFQ== MIME-Version: 1.0 X-Received: by 10.58.187.4 with SMTP id fo4mr18051174vec.55.1374764876050; Thu, 25 Jul 2013 08:07:56 -0700 (PDT) In-Reply-To: <51f13cc5$0$29971$c3e8da3$5496439d@news.astraweb.com> References: <51EF2AD8.3080105@stoneleaf.us> <51f0bc34$0$29971$c3e8da3$5496439d@news.astraweb.com> <51f0d36c$0$29971$c3e8da3$5496439d@news.astraweb.com> <51f0f38b$0$29971$c3e8da3$5496439d@news.astraweb.com> <51f13cc5$0$29971$c3e8da3$5496439d@news.astraweb.com> Date: Fri, 26 Jul 2013 01:07:55 +1000 Subject: Re: Python 3: dict & dict.keys() From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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: 24 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1374764885 news.xs4all.nl 15957 [2001:888:2000:d::a6]:36053 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:51231 On Fri, Jul 26, 2013 at 12:57 AM, Steven D'Aprano wrote: > [ snip lengthy explanation of sets ] > The union operator ought to > be symmetrical, a =E2=88=AA b should be identical to b =E2=88=AA a, but i= sn't. Another > leaky abstraction. Right. I agree with all your theory, which is fine and good. If we had a "set of real numbers", then each one would be both equal to and indistinguishable from any other representation of itself. But Python doesn't work with real numbers. It works with ints and floats and Fractions and Decimals and Guido-knows-what. (Sorry, I don't normally talk like that, but the expression begged to be said. :) ) So since Python already lets its abstraction leak a bit for usefulness, why not retain the exact same leak when working with a dict? A set is a dict with no values... a dict is a set with extra payload. They're given very similar literal notation; if they were meant to be more distinct, why was no alternative symbol used? (I love how a random side comment can become a topic of its own.) ChrisA