Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!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.005 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; '(at': 0.04; 'difference,': 0.09; 'cc:addr:python-list': 0.11; 'dictionaries': 0.16; 'evaluating': 0.16; 'from:addr:pobox.com': 0.16; 'from:addr:skip': 0.16; 'least)': 0.16; 'subject:dictionaries': 0.16; 'symmetric': 0.16; "{'a':": 0.16; 'sender:addr:gmail.com': 0.17; 'wrote:': 0.18; 'feb': 0.22; 'cc:addr:python.org': 0.22; 'skip': 0.24; 'cc:2**0': 0.24; 'header:In-Reply-To:1': 0.27; 'correct': 0.29; 'wonder': 0.29; 'sets': 0.30; 'message-id:@mail.gmail.com': 0.30; '25,': 0.31; 'operations': 0.35; 'received:google.com': 0.35; 'possible': 0.36; 'two': 0.37; 'pm,': 0.38; 'such': 0.63; 'to:addr:gmail.com': 0.65; 'union,': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=8xodiDrgluiHGbtdBdMeSe1yyVMR7MRL5nECkSiJxFc=; b=RoP9DfCTrEhIdcOMXGfxKlEK+49UkSIZsqtooU+hOMCQ8nr+OJj+A6DYmyiwRXZxhT nj7RNJKmGSlwrimpUKKKgIJjlqycnowu5B6X/KyC5rIZYXntAo4S7b4WjT/YLEV3lNYT 4brGoJobwfuDGRwtRPPYiqH08gPY0VgfhYus4a7rStTjwVwu5cCgtmoFdEE35R6UOiyN t5Klu0Q2ipH33cinAi181nRRnv3UpNimpYzVspq8oooNirmGK5O13OrMoTnvbBkTpTK+ W7TpLvswFyY/5zZ3NHxtNQjoUOAlPkW9oBF0ymUoVVwkOWQ5Nb1sjM2boGS4YHe9IBKC 6yEQ== MIME-Version: 1.0 X-Received: by 10.43.57.19 with SMTP id we19mr1783820icb.89.1393360854355; Tue, 25 Feb 2014 12:40:54 -0800 (PST) Sender: skip.montanaro@gmail.com In-Reply-To: References: Date: Tue, 25 Feb 2014 14:40:54 -0600 X-Google-Sender-Auth: 7LAxKi7OWrG7nL1IfteyFAaRkdk Subject: Re: intersection, union, difference, symmetric difference for dictionaries From: Skip Montanaro To: mauro Content-Type: text/plain; charset=UTF-8 Cc: Python 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: 12 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1393360857 news.xs4all.nl 2870 [2001:888:2000:d::a6]:43495 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:67056 On Tue, Feb 25, 2014 at 2:32 PM, mauro wrote: > So I wonder why operations such us intersection, union, difference, > symmetric difference that are available for sets and are not available > for dictionaries without going via key dictviews. What's the correct result of evaluating this expression? {'A': 1} | {'A': 2} I can see (at least) two possible "correct" answers. Skip