This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author rhettinger
Recipients Balakrishnan.B, Giacomo.Alzetta, docs@python, r.david.murray, rhettinger, steven.daprano, stutzbach, terry.reedy
Date 2014-03-15.20:52:22
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1394916743.0.0.408749687909.issue20902@psf.upfronthosting.co.za>
In-reply-to
Content
Thanks Terry.  

And yes, your reading of the set.update() docs is correct, "Update the set, adding elements from all others" means that it updates the set by adding the elements from the other sets.

FWIW, getting into details about "which value wins" goes against the core concept of the data structure.  Sets (in a mathematical sense) are about treating elements of an equivalence class as being identical.  We intentionally treat {1, 1.1} as being of length one and equal to {1.1, 1} eventhough the integer 1 and the float 1.0 are actually distinguishable in ways not tested by equality.

This isn't just a concept with sets.  The dict.update() method works similarly as does other container operations that depend on a notion of equivalence that is independent of other distinctive traits (object identity, attached values, type, etc).
History
Date User Action Args
2014-03-15 20:52:23rhettingersetrecipients: + rhettinger, terry.reedy, stutzbach, steven.daprano, r.david.murray, docs@python, Giacomo.Alzetta, Balakrishnan.B
2014-03-15 20:52:22rhettingersetmessageid: <1394916743.0.0.408749687909.issue20902@psf.upfronthosting.co.za>
2014-03-15 20:52:22rhettingerlinkissue20902 messages
2014-03-15 20:52:22rhettingercreate