I don't mean because the standard says so, but the rationale for it. The specification says:
If a comma-separated sequence of key/datum pairs is given, they are evaluated from left to right to define the entries of the dictionary: each key object is used as a key into the dictionary to store the corresponding datum. This means that you can specify the same key multiple times in the key/datum list, and the final dictionary’s value for that key will be the last one given.
This means that it's perfectly legal to form a dict
by:
d = { 'a': 1, 'b':2, 'b':3 }
However I hardly see any reason why one would like to define it that way, most often I'd guess that was a mistake. If you compare keyword arguments to a function the corresponding construct is forbidden.
Is there a good way to avoid this?