-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
RUF046
is doing two things instead of one
#14793
Comments
Oh no! Don't worry too much about it. The rule is in preview. We're still allowed to make changes to its intent.
Can you tell me a bit more about it? Do you mean that the rule fixes |
@MichaReiser Yes, that's correct. There will be a |
The suggested split makes sense to me. So we'd have two rules:
Do you want to a) first simplify |
(It's actually I intend to extend |
I know that 0.8.2 has just been released and that I did say everything looked fine to me before #14697 was merged, but the more I think about it, the more I find it wrong to handle both
round()
andint()
in one fell swoop. I probably won't be able to sleep well tonight without first sharing my concerns, so here's the big proposal:RUF046
should only handle cases where theint()
call is unnecessary. The logic to detectround()
calls with unnecessary second argument should be moved to a new rule.This will also make it easier to extend
RUF046
to handle expressions more complex than a simple call, as it won't need to care about the exact content.The text was updated successfully, but these errors were encountered: