Skip to content

support non-standard "self" and "cls" param names in pyrefly report #3095#3126

Closed
jorenham wants to merge 1 commit intofacebook:mainfrom
jorenham:gh-3095
Closed

support non-standard "self" and "cls" param names in pyrefly report #3095#3126
jorenham wants to merge 1 commit intofacebook:mainfrom
jorenham:gh-3095

Conversation

@jorenham
Copy link
Copy Markdown
Contributor

Summary

This adds support for detecting instance/class-bound method (first) parameters that aren't named self or cls. It will, for example, now correctly count __new__(_cls) -> Self as annotated.

Fixes #3095

Test Plan

Added unit tests and integration tests

@github-actions
Copy link
Copy Markdown

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

@meta-codesync
Copy link
Copy Markdown
Contributor

meta-codesync bot commented Apr 15, 2026

@rchen152 has imported this pull request. If you are a Meta employee, you can view this in D100901334.

Copy link
Copy Markdown
Contributor

@stroxler stroxler left a comment

Choose a reason for hiding this comment

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

Review automatically exported from Phabricator review in Meta.

@meta-codesync meta-codesync bot closed this in 17454b0 Apr 15, 2026
@meta-codesync
Copy link
Copy Markdown
Contributor

meta-codesync bot commented Apr 15, 2026

@rchen152 merged this pull request in 17454b0.

@jorenham jorenham deleted the gh-3095 branch April 15, 2026 17:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pyrefly report: first __new__ parameters not named cls are counted as untyped

2 participants