如何在不必导入副本的情况下制作字典的深层副本?蟒蛇

时间:2016-11-10 17:32:18

标签: python dictionary copy deep-copy

鉴于此词典

db = {'M':[("One",1400,30.0, 20.5,"oil paint","Austria"),("Three",1430,100.0,102.0,"watercolor","France"),("Twenty",1395,50.0,200.0,"tempera","France")],
            'P':[("Eight",1460, 225.0, 200.0, "fresco","Netherlands"),("Six",1465,81.0, 127.1, "tempera", "Netherlands")],
            'V':[("Four",1661, 148.0, 257.0,"oil paint", "Austria"),("Two",1630, 91.0, 77.0, "oil paint","USA")],
            'K':[("Five",1922,63.8,48.1,"watercolor","USA"),("Seven",1950,61.0,61.0,"acrylic paint","USA"),("Two",1965,81.3,100.3,"oil paint","United Kingdom")],
            'C':[("Ten",1496,365.0,389.0,"tempera","Italy")],
            'U':[("Nine",1203,182.0, 957.0,"egg tempera","Italy"), ("Twelve",1200,76.2,101.6,"egg tempera","France")]
            }

如何在不必import copy的情况下制作字典的深层副本?

0 个答案:

没有答案