intersection, union, difference, symmetric difference for dictionaries

Ben Finney ben+python at benfinney.id.au
Wed Feb 26 00:14:30 CET 2014


MRAB <python at mrabarnett.plus.com> writes:

> On 2014-02-25 21:27, Ben Finney wrote:
> > Peter Otten <__peter__ at 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.

-- 
 \         “Alternative explanations are always welcome in science, if |
  `\   they are better and explain more. Alternative explanations that |
_o__) explain nothing are not welcome.” —Victor J. Stenger, 2001-11-05 |
Ben Finney




More information about the Python-list mailing list