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

Method __sub__

IPython/utils/ipstruct.py:179–192  ·  view source on GitHub ↗

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

(self,other)

Source from the content-addressed store, hash-verified

177 return sout
178
179 def __sub__(self,other):
180 """s1 - s2 -> remove keys in s2 from s1.
181
182 Examples
183 --------
184 >>> s1 = Struct(a=10,b=30)
185 >>> s2 = Struct(a=40)
186 >>> s = s1 - s2
187 >>> s
188 {'b': 30}
189 """
190 sout = self.copy()
191 sout -= other
192 return sout
193
194 def __isub__(self,other):
195 """Inplace remove keys from self that are in other.

Callers

nothing calls this directly

Calls 1

copyMethod · 0.95

Tested by

no test coverage detected