On May 4, 2016 2:47 AM, "Pavol Lisy" firstname.lastname@example.org wrote:
2016-05-04 6:03 GMT+02:00, Nick Coghlan email@example.com:
I was curious as to whether or not it was technically feasible to implement this "duplicate keys" check solely for dict displays in CPython without impacting other dict use cases, and it turns out it should be.
- Report a DeprecationWarning in 3.6
- Report a [RuntimeError? ValueError?] in 3.7+
But what about SyntaxError instead of RuntimeError? Could it be easily done too?
Is it really a SyntaxError? The compiler knows what the source code means, but it assumes that the meaning is not what you intended.