Skip to content

Commit

Permalink
Enable copying of Configs.
Browse files Browse the repository at this point in the history
  • Loading branch information
ktlim authored and timj committed Sep 4, 2019
1 parent c96e915 commit 4c1be64
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions python/lsst/pex/config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -937,6 +937,14 @@ def update(self, **kw):
except KeyError:
raise KeyError("No field of name %s exists in config type %s" % (name, _typeStr(self)))

def copy(self):
"""!Return a copy of this config.
The copy is frozen if the config copied was frozen; copying should
occur before freezing if the copy is to be modified.
"""
return copy.deepcopy(self)

def load(self, filename, root="config"):
"""Modify this config in place by executing the Python code in a
configuration file.
Expand Down

0 comments on commit 4c1be64

Please sign in to comment.