Add defaults to this object, overwriting any which already exist
(self, defaults)
| 9 | self._user_config = config |
| 10 | |
| 11 | def add_defaults(self, defaults): |
| 12 | """Add defaults to this object, overwriting any which already exist""" |
| 13 | # Since we can't check for immutability reliably, shallow copy the |
| 14 | # value. If a mutable value were set and it were changed in one place |
| 15 | # it would affect all other instances, since this is typically called |
| 16 | # on __init__ |
| 17 | self._variable_defaults.update((d[0], copy.copy(d[1])) for d in defaults) |
| 18 | |
| 19 | def __getattr__(self, name): |
| 20 | if name == "_variable_defaults": |