ChainMap的new_child没成功
from collections import ChainMap # new_child(map) user_dict1 = {'a': 'bobby1', 'b': 'bobby2'} user_dict2 = {'c': 'bobby3', 'd': 'bobby4'} new_dict = ChainMap(user_dict1, user_dict2) new_dict.new_child({'aa': 'aa', 'bb': 'bb'}) for key, vaule in new_dict.items(): print(key, vaule)
使用的是Python3.8