diff --git a/python/lsst/pex/config/config.py b/python/lsst/pex/config/config.py index f73dfb6c..1735b7b2 100644 --- a/python/lsst/pex/config/config.py +++ b/python/lsst/pex/config/config.py @@ -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.