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)
| 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). |