MartinThoma / flake8-simplify

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

[New Rule]: rewrite dict.get(key, None) as dict.get(key) #171

Closed janosh closed 1 year ago

janosh commented 1 year ago

Explanation

dict.get(key) returns None by default if key is missing.

Example

# Bad
dict.get(key, None)

# Good
dict.get(key)

Related

Adding this rule should be coordinated with https://github.com/charliermarsh/ruff/issues/3546 for consistent naming.

kyoto7250 commented 1 year ago

I am interested in this issue. Would you mind if I tackle this issue?

In making this rule, what will the SIM number be?

MartinThoma commented 1 year ago

Go ahead :-) 🙏

The number should be SIM910