We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Check this snippet, there is an unnecessary int cast inside:
int
import math assert isinstance(math.ceil(5.5), int) assert isinstance(int(math.ceil(5.5)), int) # Extra int cast
As of refurb==1.28.0, it doesn't flag anything in this snippet.
refurb==1.28.0
I propose a new rule to refurb: detecting unnecessary casting (e.g. unnecessary int or str casts). It could be named redundant-cast.
refurb
str
redundant-cast
pylint==3.0.3, ruff==0.2.0, and flake8-simplify==0.21.0 don't flag this at the moment either.
pylint==3.0.3
ruff==0.2.0
flake8-simplify==0.21.0
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Overview
Check this snippet, there is an unnecessary
int
cast inside:As of
refurb==1.28.0
, it doesn't flag anything in this snippet.Proposal
I propose a new rule to
refurb
: detecting unnecessary casting (e.g. unnecessaryint
orstr
casts). It could be namedredundant-cast
.pylint==3.0.3
,ruff==0.2.0
, andflake8-simplify==0.21.0
don't flag this at the moment either.The text was updated successfully, but these errors were encountered: