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

repeated-isinstance-calls is a duplicate rule of duplicate-isinstance-call #8122

Open
Skylion007 opened this issue Oct 22, 2023 · 4 comments
Assignees
Labels
rule Implementing or modifying a lint rule
Milestone

Comments

@Skylion007
Copy link

These two rules do the exact same thing but, have slightly different logic. They should be an alias of one another but appear to each be there own rule:
https://docs.astral.sh/ruff/rules/repeated-isinstance-calls/ and https://docs.astral.sh/ruff/rules/duplicate-isinstance-call/ do the same thing, and have the same autofix implemented. Seems like this wasn't notice when the PR was merged #4792

@Skylion007 Skylion007 changed the title repeated-isinstance-calls is duplicate of duplicate-isinstance-call repeated-isinstance-calls is a duplicate rule of duplicate-isinstance-call Oct 22, 2023
@Skylion007
Copy link
Author

I prefer the original logic that always converted the isinstance call to check against a type tuple. While the new Union logic is really snazzy in Python 3.11, it is a little bit slower in practice and having the pyupgrade rule take care of it means we can opt out of it which is not possible with the PyLint check

@charliermarsh
Copy link
Member

Thanks, will dedupe!

@charliermarsh charliermarsh self-assigned this Oct 23, 2023
@charliermarsh charliermarsh added the rule Implementing or modifying a lint rule label Oct 23, 2023
@charliermarsh charliermarsh added this to the v0.2.0 milestone Jan 29, 2024
@zanieb
Copy link
Member

zanieb commented Jan 30, 2024

@charliermarsh do we want to deprecate one of them? which one?

@charliermarsh
Copy link
Member

@zanieb - I'd vote to keep the flake8-simplify version since we're more closely anchored to that ecosystem and it came first.

@dhruvmanila dhruvmanila modified the milestones: v0.2.0, v0.3.0 Feb 12, 2024
@MichaReiser MichaReiser modified the milestones: v0.3.0, v0.4 Feb 14, 2024
@dhruvmanila dhruvmanila modified the milestones: v0.4.0, v0.5.0 Apr 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rule Implementing or modifying a lint rule
Projects
None yet
Development

No branches or pull requests

5 participants