[Enhancement]: use of dict.setdefault
Opened this issue · 1 comments
pums974 commented
Overview
This is a suggestion for a new rule
I propose to suggest more usage of some_dict.setdefault(key, default value)
Proposal
It could replace a pattern a bit more obscure :
some_dict[key] = some_dict.get(key, default_value)
# or even
if key not in some_dict:
some_dict[key]