Issue 358
原文: PyCoder’s Weekly - Issue #358 PEP 584: 在内置 Dict 类中添加+和 - 运算符 PYTHON.ORG This PEP suggests adding merge + and difference - operators to the built-in dict class. The merge operator will have the same relationship to the dict.update method as the list concatenation operator has to list.extend, with dict difference being defined analogously. I think this is a pretty cool feature suggestion. Related discussion here. (是也乎: 简单说, 用直觉计算符号来操作最常用的 dict 对象… d = {‘spam’: 1, ’eggs’: 2, ‘cheese’: 3} e = {‘cheese’: ‘cheddar’, ‘aardvark’: ‘Ethel’} d + e {‘spam’: 1, ’eggs’: 2, ‘cheese’: ‘cheddar’, ‘aardvark’: ‘Ethel’} e + d {‘cheese’: 3, ‘aardvark’: ‘Ethel’, ‘spam’: 1, ’eggs’: 2} ) ...