[Python-ideas] dictionary constructor should not allow duplicate keys

Kyle Lahnakoski klahnakoski at mozilla.com
Wed May 4 12:15:40 EDT 2016



On 5/4/2016 11:45 AM, Chris Angelico wrote:
> On Thu, May 5, 2016 at 1:27 AM, Kyle Lahnakoski <klahnakoski at mozilla.com> wrote:
>> Now, I am lucky because I purchased
>> an IDE that highlights those duplicates as errors.  If I had to rely on
>> a separate linter...
> For the record, an IDE with the capability to highlight this kind of
> error *is* a linter. When language discussions result in "let a linter
> pick that up", that includes smart editors.

Thinking about examples [1], it turns out I was mistaken.  My IDE does
NOT have an *integrated* linter that detects duplicate literal keys!  My
IDE does detect duplicate literal keys for Javascript, which I obviously
got confused.

Oh dear!  That means my dicts are full of duplicates!     

https://github.com/klahnakoski/TestLog-ETL/blob/d7e8a99f7532a0551c98dfdccefe02c129a6123a/testlog_etl/imports/buildbot.py#L524


More information about the Python-ideas mailing list