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

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

Merged
merged 2 commits into from
Mar 30, 2023

Conversation

kyoto7250
Copy link
Contributor

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
Copy link
Contributor Author

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

@MartinThoma MartinThoma changed the title impl SIM910 ENH: Add dict.get(key, None) -> dict.get(key) as SIM910 Mar 30, 2023
@MartinThoma MartinThoma changed the title ENH: Add dict.get(key, None) -> dict.get(key) as SIM910 ENH: Add dict.get(key, None)dict.get(key) as SIM910 Mar 30, 2023
@MartinThoma MartinThoma merged commit 21375ea into MartinThoma:master Mar 30, 2023
@MartinThoma
Copy link
Owner

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

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

Successfully merging this pull request may close these issues.

[New Rule]: rewrite dict.get(key, None) as dict.get(key)
2 participants