Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!feeds.phibee-telecom.net!news.osn.de!diablo2.news.osn.de!news.tele.dk!news.tele.dk!small.news.tele.dk!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.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'mrab': 0.05; 'duplicate': 0.07; 'keys,': 0.09; '*only*': 0.16; 'dictionaries': 0.16; 'finney': 0.16; 'from:addr:mrabarnett.plus.com': 0.16; 'from:addr:python': 0.16; 'from:name:mrab': 0.16; 'implies': 0.16; 'keys.': 0.16; 'message-id:@mrabarnett.plus.com': 0.16; 'rather,': 0.16; 'received:192.168.1.4': 0.16; 'statement;': 0.16; 'subject:dictionaries': 0.16; 'wrote:': 0.18; 'unlike': 0.19; 'header:User-Agent:1': 0.23; 'values': 0.27; 'header:In-Reply- To:1': 0.27; 'point': 0.28; 'sets': 0.30; "i'm": 0.30; 'keys': 0.31; 'unique,': 0.31; 'values.': 0.31; 'writes:': 0.31; 'yes.': 0.31; 'but': 0.35; 'set.': 0.36; 'ben': 0.38; 'to:addr:python- list': 0.38; 'sure': 0.39; 'to:addr:python.org': 0.39; "you're": 0.61; 'otten': 0.84 X-CM-Score: 0.00 X-CNFS-Analysis: v=2.1 cv=eZmzft0H c=1 sm=1 tr=0 a=0nF1XD0wxitMEM03M9B4ZQ==:117 a=0nF1XD0wxitMEM03M9B4ZQ==:17 a=0Bzu9jTXAAAA:8 a=sASEtNAQL0YA:10 a=XXIWJeSQl1AA:10 a=ihvODaAuJD4A:10 a=IkcTkHD0fZMA:10 a=EBOSESyhAAAA:8 a=BoI_FEMi-AwA:10 a=M0VP7J06CPzlF3aMeSoA:9 a=QEXdDO2ut3YA:10 a=5KVauyKsRKMA:10 X-AUTH: mrabarnett:2500 Date: Tue, 25 Feb 2014 23:25:06 +0000 From: MRAB User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 To: python-list@python.org Subject: Re: intersection, union, difference, symmetric difference for dictionaries References: <85fvn6q3ws.fsf@benfinney.id.au> <530D2230.4060807@mrabarnett.plus.com> <85a9depyy1.fsf@benfinney.id.au> In-Reply-To: <85a9depyy1.fsf@benfinney.id.au> 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: 22 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1393370709 news.xs4all.nl 2904 [2001:888:2000:d::a6]:41828 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:67077 On 2014-02-25 23:14, Ben Finney wrote: > MRAB writes: > >> On 2014-02-25 21:27, Ben Finney wrote: >> > Peter Otten <__peter__@web.de> writes: >> > >> >> mauro wrote: >> >> >> >> > - Dictionaries and sets are both accessed by key >> >> >> >> but sets have no values >> > >> > Or rather, sets *only* have values. Dictionaries have keys, sets do >> > not have keys. >> > >> But a dictionary can have duplicate values, a set cannot. > > Yes. Your “but” implies you think that contradicts my statement; it > doesn't. So I'm not sure what point you're making. > The keys of a dictionary must be unique, like a set. The values of a dictionary don't have to be unique, unlike a set.