Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

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

Closed
janosh opened this issue Mar 15, 2023 · 2 comments · Fixed by #173
Closed

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

janosh opened this issue Mar 15, 2023 · 2 comments · Fixed by #173
Assignees
Labels
enhancement New feature or request

Comments

@janosh
Copy link

janosh commented Mar 15, 2023

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 astral-sh/ruff#3546 for consistent naming.

@janosh janosh added the enhancement New feature or request label Mar 15, 2023
@kyoto7250
Copy link
Contributor

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
Copy link
Owner

Go ahead :-) 🙏

The number should be SIM910

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants