__init__.py 文件源码

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

项目:CSB 作者: csb-toolbox 项目源码 文件源码
def deepcopy(obj, recursion=100000):
    """
    Perform a deep copy of obj using cPickle. Faster than copy.deepcopy()
    for large objects.

    @param obj: the object to copy
    @return: a deep copy of obj
    @param recursion: maximum recursion limit
    @type recursion: int
    """
    from csb.io import Pickle

    current = sys.getrecursionlimit()
    sys.setrecursionlimit(recursion)

    tmp = Pickle.dumps(obj, Pickle.HIGHEST_PROTOCOL)
    copy = Pickle.loads(tmp)

    sys.setrecursionlimit(current)
    return copy
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号