MartinThoma / flake8-simplify

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

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

Closed MaxG87 closed 2 years ago

MaxG87 commented 2 years ago

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 commented 2 years ago

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

https://github.com/MartinThoma/flake8-simplify/pull/131 will be merged in 1-2 hours. I then also make a release where this rule is removed.

MaxG87 commented 2 years ago

Thank you very much!

MartinThoma commented 2 years ago

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