Python 拷貝對象(深拷貝deepcopy與淺拷貝)

Python 拷貝對象(深拷貝deepcopy與淺拷貝) >>> import copy >>> a = [1,2,3,4,['a','v']] >>> b = a >>> b [1, 2, 3, 4, ['a', 'v']] >>> c = copy.copy(a) >>> c [1, 2, 3, 4, ['a', 'v']] >>> d = copy.deepcopy(a) >>> d [1,
相關文章
相關標籤/搜索