我正在尝试将字典列表转换为带有reduce函数的字典。
d1成功,但是d2失败
from functools import reduce
l1 = [{'res_model':'coffee'}, {'res_field':'name'}, {'res_id':1}]
d1 = reduce(lambda x,y:dict(x,**y),l1) # succeed
d2 = reduce(lambda x,y:x.update(y),l1) # fail, AttributeError: 'NoneType' object has no attribute 'update'