码迷,mamicode.com
首页 > Web开发 > 详细

https://stackoverflow.com/questions/3232943/update-value-of-a-nested-dictionary-of-varying-depth

时间:2020-02-13 10:04:07      阅读:74      评论:0      收藏:0      [点我收藏+]

标签:over   color   ack   style   class   stack   col   margin   val   

https://stackoverflow.com/questions/3232943/update-value-of-a-nested-dictionary-of-varying-depth

 

import copy

d = {‘k‘: ‘kv‘}
j_sc = {‘k1‘: copy.copy(d)}
j_dc = {‘k1‘: copy.deepcopy(d)}
jc = {‘k1‘: d.copy()}
k = {‘k1‘: d}
d = {‘j‘: ‘jv‘}

https://stackoverflow.com/questions/3232943/update-value-of-a-nested-dictionary-of-varying-depth

标签:over   color   ack   style   class   stack   col   margin   val   

原文地址:https://www.cnblogs.com/yuanjiangw/p/11917367.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!