MartinThoma / flake8-simplify

❄ A flake8 plugin that helps you to simplify code
MIT License
187 stars 19 forks source link

ENH: Add `dict.get(key, None)` → `dict.get(key)` as SIM910 #173

Closed kyoto7250 closed 1 year ago

kyoto7250 commented 1 year ago

close #171

This PR implements the rules of SIM910. This rule detects dict.get(key, None).

ref: https://docs.python.org/3/library/stdtypes.html?highlight=dict#dict.get

kyoto7250 commented 1 year ago

We should use BOOL_CONST_TYPES for Python3.7 and earlier compatibility.

MartinThoma commented 1 year ago

Thank you :hugs: I'll release flake8-simplify==0.20.0 with that change today