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