datatype.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:passmaker 作者: bit4woo 项目源码 文件源码
def __deepcopy__(self, memo):
        retVal = self.__class__()
        memo[id(self)] = retVal

        for attr in dir(self):
            if not attr.startswith('_'):
                value = getattr(self, attr)
                if not isinstance(value, (types.BuiltinFunctionType, types.FunctionType, types.MethodType)):
                    setattr(retVal, attr, copy.deepcopy(value, memo))

        for key, value in self.items():
            retVal.__setitem__(key, copy.deepcopy(value, memo))

        return retVal
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号