MCPcopy Index your code
hub / github.com/ipython/ipython / __isub__

Method __isub__

IPython/utils/ipstruct.py:194–208  ·  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

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

Callers

nothing calls this directly

Calls 1

keysMethod · 0.80

Tested by

no test coverage detected