X-Received: by 10.52.236.231 with SMTP id ux7mr10214858vdc.7.1393707764481; Sat, 01 Mar 2014 13:02:44 -0800 (PST) MIME-Version: 1.0 Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!peer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!w5no4083828qac.0!news-out.google.com!dr7ni240qab.1!nntp.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!ottix-news.ottix.net!newsswitch.lcs.mit.edu!nntp.TheWorld.com!newsfeed-00.mathworks.com!panix!not-for-mail From: Grant Edwards Newsgroups: comp.lang.python Subject: Re: intersection, union, difference, symmetric difference for dictionaries Date: Tue, 25 Feb 2014 20:44:19 +0000 (UTC) Organization: PANIX Public Access Internet and UNIX, NYC Lines: 21 Message-ID: References: NNTP-Posting-Host: dsl.comtrol.com X-Trace: reader1.panix.com 1393361059 163 64.122.56.22 (25 Feb 2014 20:44:19 GMT) X-Complaints-To: abuse@panix.com NNTP-Posting-Date: Tue, 25 Feb 2014 20:44:19 +0000 (UTC) User-Agent: slrn/1.0.1 (Linux) X-Received-Bytes: 1882 X-Received-Body-CRC: 3287985865 Xref: csiph.com comp.lang.python:67359 On 2014-02-25, mauro wrote: > Dictionaries and sets share a few properties: > - Dictionaries keys are unique as well as sets items > - Dictionaries and sets are both unordered > - Dictionaries and sets are both accessed by key > - Dictionaries and sets are both mutables > > 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 would be the definition of the union, intersection, and difference of these two dicts? {1:'blue', 2:'red'} {1:'green', 3:'yellow'} -- Grant Edwards grant.b.edwards Yow! I smell like a wet at reducing clinic on Columbus gmail.com Day!