class dcp(obj, die=True, verbose=True)[source]#

Shortcut to perform a deep copy operation

Almost identical to copy.deepcopy(), but optionally fall back to copy.copy() if deepcopy fails.

  • die (bool) – if False, fall back to copy()

  • verbose (bool) – if die is False, then print a warning if deepcopy() fails

New in version 2.0.0: default die=True instead of False