就python约定+速度而言,通常首选什么?就像是:
class Object(object):
def __init__(self, other_object=None):
if other_object:
self.value = other_object.value
else:
self.value = something
进而
obj = Object(other_object)
或者,使用复制():
from copy import copy
obj = copy(other_object)