Raymond Hettinger added the comment:

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).

----------
resolution:  -> invalid
status: open -> closed

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue20902>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to