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 terry.reedy
Recipients Balakrishnan.B, Giacomo.Alzetta, docs@python, r.david.murray, rhettinger, steven.daprano, stutzbach, terry.reedy
Date 2014-03-14.23:56:39
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1394841399.49.0.929605961713.issue20902@psf.upfronthosting.co.za>
In-reply-to
Content
Defining equality to ignore the .value attribute (and the id), says that they *do not matter*. Python believes you and the interpreter does what it does. If we had made a 'first or second operand wins' claim, we would not have been able to optimize intersection by starting with the smaller set. I may mis-remember but I believe we changed after someone noticed that something like {1] & set(range(10000)) versus set(range(10000)) & {1} had very different run times.

I agree with Raymond that the docs for intersection and union should be left as is.

I could read the doc for A.intersection_update(B) as saying that it keeps all items in A that also appear in B, with appear defined on the basis of ==, so that the result is a subset of the actual items in A. If that is the intent, it could be made clearer.

The doc A.update(B) (union) come close to saying that all items in A remain and items in B not in A get added, so that the result all the items in A. Again, if that is the intent, it could be made explicit, and people who want to determine which operand wins could use the update functions to do so.
History
Date User Action Args
2014-03-14 23:56:39terry.reedysetrecipients: + terry.reedy, rhettinger, stutzbach, steven.daprano, r.david.murray, docs@python, Giacomo.Alzetta, Balakrishnan.B
2014-03-14 23:56:39terry.reedysetmessageid: <1394841399.49.0.929605961713.issue20902@psf.upfronthosting.co.za>
2014-03-14 23:56:39terry.reedylinkissue20902 messages
2014-03-14 23:56:39terry.reedycreate