[issue16385] evaluating literal dict with repeated keys gives no warnings/errors

Benjamin Peterson report at bugs.python.org
Fri Nov 2 16:49:24 CET 2012


Benjamin Peterson added the comment:

An error is out of the question for compatibility reasons. I think the idea for a warning should be brought up on the python-ideas list. Silently rejecting duplicates has a lot of precedent, though. For example, set literals and the dict constructor:

>>> dict((("dfs", 2), ("dfs", 3)))
{'dfs' : 3}

----------
nosy: +benjamin.peterson

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue16385>
_______________________________________


More information about the Python-bugs-list mailing list