Update the set, removing any elements from other which are in the set.
(self, other)
| 130 | del self.items[item] |
| 131 | |
| 132 | def difference_update(self, other): |
| 133 | """Update the set, removing any elements from other which are in |
| 134 | the set. |
| 135 | """ |
| 136 | |
| 137 | if not isinstance(other, Set): |
| 138 | raise ValueError("other must be a Set instance") |
| 139 | if self is other: # lgtm[py/comparison-using-is] |
| 140 | self.items.clear() |
| 141 | else: |
| 142 | for item in other.items: |
| 143 | self.discard(item) |
| 144 | |
| 145 | def symmetric_difference_update(self, other): |
| 146 | """Update the set, retaining only elements unique to both sets.""" |