Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

[SIM903] False-positive for datetime and date #130

Closed
MaxG87 opened this issue Mar 29, 2022 · 3 comments · Fixed by #131
Closed

[SIM903] False-positive for datetime and date #130

MaxG87 opened this issue Mar 29, 2022 · 3 comments · Fixed by #131
Assignees
Labels
enhancement New feature or request

Comments

@MaxG87
Copy link

MaxG87 commented Mar 29, 2022

Desired change

SIM903 should not be flagged in the following snippet:

import datetime as dt

time = dt.datetime(2022, 3, 29, 12, 0, 0)
date = dt.date(2022, 3, 29)

Explanation

In the given example, I would consider added keywords to be distracting boilerplate. I think in the given example it is obvious what the arguments mean.

@MartinThoma
Copy link
Owner

Uh, right. This rule has some other issues (positional-only arguments). I've already moved SIM902 to flake8-scream for this reason.

#131 will be merged in 1-2 hours. I then also make a release where this rule is removed.

@MaxG87
Copy link
Author

MaxG87 commented Mar 29, 2022

Thank you very much!

@MartinThoma
Copy link
Owner

flake8-simplify==0.19.2 was just released with the fix :-)

@MartinThoma MartinThoma changed the title [Adjust Rule] SIM903 [SIM903] False-positive for datetime and date Mar 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants