📅  最后修改于: 2022-03-11 14:46:45.196000             🧑  作者: Mango
import copy
class A(object):
def __init__(self, a)
self.a = a
a = A(38)
# Deepcopy
a2 = copy.deepcopy(a)
# Shallow copy -> use this if copy.deepcopy() fails
a3 = copy.copy(a)