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

Method __iadd__

IPython/utils/ipstruct.py:150–162  ·  view source on GitHub ↗

s += s2 is a shorthand for s.merge(s2). Examples -------- >>> s = Struct(a=10,b=30) >>> s2 = Struct(a=20,c=40) >>> s += s2 >>> sorted(s.keys()) ['a', 'b', 'c']

(self, other)

Source from the content-addressed store, hash-verified

148 return result
149
150 def __iadd__(self, other):
151 """s += s2 is a shorthand for s.merge(s2).
152
153 Examples
154 --------
155 >>> s = Struct(a=10,b=30)
156 >>> s2 = Struct(a=20,c=40)
157 >>> s += s2
158 >>> sorted(s.keys())
159 ['a', 'b', 'c']
160 """
161 self.merge(other)
162 return self
163
164 def __add__(self,other):
165 """s + s2 -> New Struct made from s.merge(s2).

Callers

nothing calls this directly

Calls 1

mergeMethod · 0.95

Tested by

no test coverage detected