Merge a dict of options into this object. Options that have None value are ignored. Lists and tuples are appended to the current option value.
(self, opts)
| 285 | return self._options[option].has_changed() |
| 286 | |
| 287 | def merge(self, opts): |
| 288 | """ |
| 289 | Merge a dict of options into this object. Options that have None |
| 290 | value are ignored. Lists and tuples are appended to the current |
| 291 | option value. |
| 292 | """ |
| 293 | toset = {} |
| 294 | for k, v in opts.items(): |
| 295 | if v is not None: |
| 296 | if isinstance(v, (list, tuple)): |
| 297 | toset[k] = getattr(self, k) + v |
| 298 | else: |
| 299 | toset[k] = v |
| 300 | self.update(**toset) |
| 301 | |
| 302 | def __repr__(self): |
| 303 | options = pprint.pformat(self._options, indent=4).strip(" {}") |