dcp(obj, die=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.copy()

New in version 2.0.0: default die=True instead of False
New in version 3.1.4: die=False passed to sc.cp(); “verbose” argument removed; warning raised