Why is there no symmetric difference for collections.Counter?
问题 So for sets you can do a symmetric difference (^) which is the equivalent of union minus intersection. Why is ^ an unsupported operand for Counter objects while union and intersection still work? 回答1: Expanding on my comment, turns out it was discussed at time, and rejected. Click the link for the full message (and its thread); I'll just quote the "high order bits" of Raymond Hettinger's reply: It's unlikely that I will add this [symmetric difference] method to the Counter API because the