MCPcopy Create free account
hub / github.com/ipython/ipython / __isub__

Method __isub__

IPython/utils/ipstruct.py:200–215  ·  view source on GitHub ↗

Inplace remove keys from self that are in other. Examples -------- >>> s1 = Struct(a=10,b=30) >>> s2 = Struct(a=40) >>> s1 -= s2 >>> s1 {'b': 30}

(self,other)

Source from the content-addressed store, hash-verified

198 return sout
199
200 def __isub__(self,other):
201 """Inplace remove keys from self that are in other.
202
203 Examples
204 --------
205
206 >>> s1 = Struct(a=10,b=30)
207 >>> s2 = Struct(a=40)
208 >>> s1 -= s2
209 >>> s1
210 {'b': 30}
211 """
212 for k in other.keys():
213 if k in self:
214 del self[k]
215 return self
216
217 def __dict_invert(self, data):
218 """Helper function for merge.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected