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

Method __iadd__

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

151 return result
152
153 def __iadd__(self, other):
154 """s += s2 is a shorthand for s.merge(s2).
155
156 Examples
157 --------
158
159 >>> s = Struct(a=10,b=30)
160 >>> s2 = Struct(a=20,c=40)
161 >>> s += s2
162 >>> sorted(s.keys())
163 ['a', 'b', 'c']
164 """
165 self.merge(other)
166 return self
167
168 def __add__(self,other):
169 """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