素朴な疑問:Python辞書リテラルの割り当て:セマンティクスは保証されていますか?
Python 2.6.6 (r266:84292, Aug 9 2016, 06:11:56)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-17)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> d = {'foo':1,'foo':2}
>>> print d
{'foo': 2}
>>> d = {'foo':2,'foo':1}
>>> print d
{'foo': 1}
だから、私は、変数への重複キーを持つリテラル辞書を割り当てた場合、それは、少なくともこの特定のPythonのバージョンのために、使用され、第2の鍵/ペアであると思われます。
この動作は保証されていますか? Dictionary displays documentationから
重複:https://stackoverflow.com/questions/39678672/is-a-python-dict-comprehension-always-last-wins-if-there-are-duplicate-keys – lqez