[ty] Bind `typing.Self` in class attributes and assignment
by charliermarsh
·
Feb 06, 2026 at 19:13 UTC
·
scan-2820359b8fc9e14c
Get this automatically on every PR
Install the Axiomo GitHub App to get Signals as check runs and PR comments on every pull request.
Risk level: Critical (79%)
Bind `typing.Self` in class attributes and assignments.
attributes.md contains updates applying `Self` to `__getattr__`.
types.rs includes method for binding `Self` in non-function types.
diagnostics changes remove false positive relating to `Self`.
Trusted contributor with 3044 merged PRs. has 6228 followers. unfamiliar with 3 files.
Review 1 high-priority file(s)
crates/ty_python_semantic/src/types.rs
+198
198 lines changed; Source code
crates/ty_python_semantic/src/types/infer/builder.rs
+13
Source code
crates/ty_python_semantic/src/types/signatures.rs
+17
Source code
crates/ty_python_semantic/src/types/relation.rs
+9
Source code
crates/ty_python_semantic/src/types/generics.rs
+7
Source code
crates/ty_python_semantic/resources/mdtest/annotations/self.md
+288
288 lines changed
crates/ty_python_semantic/resources/mdtest/attributes.md
+21
Standard file
crates/ty_python_semantic/resources/mdtest/snapshots/special_form_attribu…_-_Diagnostics_for_inva…_(249d635e74a41c9e).snap
+18
Standard file
crates/ty_python_semantic/resources/mdtest/diagnostics/special_form_attributes.md
+4
Standard file
52
minutes to review
high
effort level
none
staleness risk
Allocate focused review time
Critical risk level requires changes before approval
Why is lint_passing missing? Consider adding this check.
Why is security_scan_clean missing? Consider adding this check.