Skip to content

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.

@github-actions
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)

Copy link
Collaborator

@cdce8p cdce8p left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks @Skylion007.

@JukkaL JukkaL merged commit f66741c into python:master Feb 19, 2025
18 checks passed
x612skm pushed a commit to x612skm/mypy-dev that referenced this pull request Feb 24, 2025
Enforce no unnecessary duplicate isinstance calls (that could be merged
into a tuple call).
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.

4 participants