Skip to content

Add fast path for checking self types#16352

Merged
JukkaL merged 1 commit intomasterfrom
fast-self-type
Oct 28, 2023
Merged

Add fast path for checking self types#16352
JukkaL merged 1 commit intomasterfrom
fast-self-type

Conversation

@JukkaL
Copy link
Copy Markdown
Collaborator

@JukkaL JukkaL commented Oct 28, 2023

The check was pretty expensive, though usually it's not doing anything non-trivial. Added a fast path for cases where we use the implicit self type, which covers the vast majority of cases.

This makes self-check about 4% faster.

The check was pretty expensive, though usually it's not doing
anything non-trivial. Added a fast path for cases where we use the
implicit self type, which covers the vast majority of cases.

This makes self-check about 4% faster.
Copy link
Copy Markdown
Member

@ilevkivskyi ilevkivskyi left a comment

Choose a reason for hiding this comment

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

This is really nice!

@github-actions
Copy link
Copy Markdown
Contributor

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

@JukkaL JukkaL merged commit c76132f into master Oct 28, 2023
@JukkaL JukkaL deleted the fast-self-type branch October 28, 2023 14:00
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.

2 participants