Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Mypy micro-optimizations (batch 1/3)#19768

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
hauntsaninja merged 4 commits intomasterfrommypy-opts-1
Aug 31, 2025
Merged

Mypy micro-optimizations (batch 1/3)#19768

hauntsaninja merged 4 commits intomasterfrommypy-opts-1
Aug 31, 2025

Conversation

@JukkaL
Copy link
Collaborator

@JukkaLJukkaL commentedAug 31, 2025
edited
Loading

Several mypy micro-optimizations. Together with batches 2 and 3 these improve self check performance by 1.8%.

@github-actions
Copy link
Contributor

According tomypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

@hauntsaninjahauntsaninja merged commit87f4dc8 intomasterAug 31, 2025
20 checks passed
@hauntsaninjahauntsaninja deleted the mypy-opts-1 branchAugust 31, 2025 22:36
Comment on lines -2126 to +2128
self.variables=variables
self.variables:tuple[TypeVarLikeType, ...]
ifvariablesisNone:
self.variables= ()
else:
self.variables=tuple(variables)
Copy link
Collaborator

@cdce8pcdce8pSep 1, 2025
edited
Loading

Choose a reason for hiding this comment

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

Note, this does crash thepydantic.v1 extension.

File"/.../python3.13/site-packages/pydantic/v1/mypy.py",line868,inadd_methodsignature.variables= [tvar_def]^^^^^^^^^^^^^^^^^^^TypeError:tupleobjectexpected;gotlist

https://github.com/pydantic/pydantic/blob/v2.11.7/pydantic/v1/mypy.py#L866-L868

It can fairly easily be fixed and I'll open a PR for it soon. However, that might not be the only plugin which depends on it being "just" a sequence.

hauntsaninja reacted with thumbs up emoji
Copy link
CollaboratorAuthor

Choose a reason for hiding this comment

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

If we have evidence that this impacts multiple plugins, we can consider reverting this change.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@hauntsaninjahauntsaninjahauntsaninja approved these changes

+1 more reviewer

@cdce8pcdce8pcdce8p left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@JukkaL@hauntsaninja@cdce8p

[8]ページ先頭

©2009-2025 Movatter.jp