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

Enable ruff SIM101 duplicate isinstance check #18679

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Skylion007
Copy link
Contributor

@Skylion007 Skylion007 commented Feb 14, 2025

Enforce no unnecessary duplicate isinstance calls (that could be merged into a tuple call).

@Skylion007
Copy link
Contributor Author

Skylion007 commented Feb 14, 2025

We already do a good job enforcing this throughout the codebase (only 1 fix was necessary); let's make it explicit to ensure we are maximizing performance and readability.

Copy link
Contributor

Diff from mypy_primer, showing the effect of this PR on open source code:

Tanjun (https://github.com/FasterSpeeding/Tanjun): 1.40x faster (134.4s -> 95.9s in a single noisy sample)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant