Overview
Check this snippet, there is an unnecessary int cast inside:
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.
Proposal
I propose a new rule to refurb: detecting unnecessary casting (e.g. unnecessary int or str casts). It could be named redundant-cast.
pylint==3.0.3, ruff==0.2.0, and flake8-simplify==0.21.0 don't flag this at the moment either.
Overview
Check this snippet, there is an unnecessary
intcast 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. unnecessaryintorstrcasts). It could be namedredundant-cast.pylint==3.0.3,ruff==0.2.0, andflake8-simplify==0.21.0don't flag this at the moment either.