TypeError: unhashable type: 'collections.OrderedDict'

 

for repo in json_str.items():
    json_str[repo]['name']="123"

 

其中json_str为一个OrderedDict类型的多层字典,执行中报TypeError: unhashable type: 'collections.OrderedDict'错误
解决方法:

for repo ,config in json_str.items():
    json_str[repo]['name']="123"

 

posted @ 2018-12-19 14:08  六日周  阅读(1024)  评论(0编辑  收藏  举报