python--深拷贝和浅拷贝
摘要:
先上例子 1 def test_fun(): 2 a = [1, "hi", [2, 3], {"key": "123"}] 3 b = copy.copy(a) 4 c = copy.deepcopy(a) 5 print('id(a)=',id(a)) 6 print('id(b)=',id(b 阅读全文
posted @ 2021-03-04 13:22 kimber_kimber 阅读(33) 评论(0) 推荐(0) 编辑