python-benedict/benedict/core/clone.py

9 lines
132 B
Python
Raw Permalink Normal View History

import copy
def clone(obj, empty=False, memo=None):
d = copy.deepcopy(obj, memo)
if empty:
d.clear()
return d