📜  python 复制实例 - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:45.196000             🧑  作者: Mango

代码示例2
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)