Is there a static code analysis tool that can flag duplicate keys in a python dictionary?
Context: I use large dictionary to capture tasks in a scheduler. If mistakenly key name for two tasks are the same then the 2nd item replaces the 1st item silently and we lose one task in the the schedule.
I was hoping if we can flag this duplicate key using code analysis (lint).
Code example:
d = {'a': 1,'b': 2, 'a': 3}
print(d.items())
>>dict_items([('a', 3), ('b', 2)])