MCPcopy Create free account
hub / github.com/rthalley/dnspython / difference_update

Method difference_update

dns/set.py:132–143  ·  view source on GitHub ↗

Update the set, removing any elements from other which are in the set.

(self, other)

Source from the content-addressed store, hash-verified

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

Callers 5

__isub__Method · 0.95
differenceMethod · 0.80
testBadUpdatesMethod · 0.80
testSelfUpdatesMethod · 0.80

Calls 2

discardMethod · 0.95
clearMethod · 0.45

Tested by 2

testBadUpdatesMethod · 0.64
testSelfUpdatesMethod · 0.64