Back

ruff #23108

[ty] Bind `typing.Self` in class attributes and assignment

by charliermarsh · Feb 06, 2026 at 19:13 UTC · scan-2820359b8fc9e14c

Critical Risk (79%)

Get this automatically on every PR

Install the Axiomo GitHub App to get Signals as check runs and PR comments on every pull request.

Install App

Risk Assessment

Risk level: Critical (79%)

Risk Drivers

  • large_diff: Large change: 575 lines modified
  • multiple_concerns: Spans 7 directories
  • missing_tests: Added 214 lines of code but only 0 lines of tests
  • api_surface_change: API surface changed in 3 file(s)

Intent

3/3 criteria met

Bind `typing.Self` in class attributes and assignments.

Non-Goals

  • - Refactor unrelated class methods

Acceptance Criteria

  • Bind `Self` in class attributes.

    attributes.md contains updates applying `Self` to `__getattr__`.

  • Bind `Self` in class assignments.

    types.rs includes method for binding `Self` in non-function types.

  • Resolve `Self` correctly in diagnostics.

    diagnostics changes remove false positive relating to `Self`.

Confidence: 90.0% Source: diff analysis AI: openai

Contributors

charliermarsh PR Author 6 commits + Trusted
Account Age: 5145 days
Prior PRs: 3157
Merged: 3044

Trusted contributor with 3044 merged PRs. has 6228 followers. unfamiliar with 3 files.

Evidence

Evidence Completeness: 43.0%
ci_passing Unavailable
build_successful Unavailable
tests_passing Passing
Missing: lint_passing, security_scan_clean, coverage_maintained

Supply Chain

None Risk
Modifies dependencies
Modifies lockfile
Modifies CI config
Modifies build scripts

Focus Files

Review 1 high-priority file(s)

crates/ty_python_semantic/src/types.rs +198

198 lines changed; Source code

high
crates/ty_python_semantic/src/types/infer/builder.rs +13

Source code

medium
crates/ty_python_semantic/src/types/signatures.rs +17

Source code

medium
crates/ty_python_semantic/src/types/relation.rs +9

Source code

medium
crates/ty_python_semantic/src/types/generics.rs +7

Source code

medium
crates/ty_python_semantic/resources/mdtest/annotations/self.md +288

288 lines changed

medium
crates/ty_python_semantic/resources/mdtest/attributes.md +21

Standard file

low
crates/ty_python_semantic/resources/mdtest/snapshots/special_form_attribu…_-_Diagnostics_for_inva…_(249d635e74a41c9e).snap +18

Standard file

low
crates/ty_python_semantic/resources/mdtest/diagnostics/special_form_attributes.md +4

Standard file

low

Triage

52

minutes to review

high

effort level

none

staleness risk

Allocate focused review time

Recommendation

REQUEST CHANGES 48.0% readiness

Critical risk level requires changes before approval

Next Steps

Question

Why is lint_passing missing? Consider adding this check.

Question

Why is security_scan_clean missing? Consider adding this check.