Skip to content

[ty] Share attribute write compatibility checks - #28555

Merged
charliermarsh merged 1 commit into
mainfrom
charlie/share-attribute-write-checks
Sep 14, 2026
Merged

charliermarsh merged 1 commit into
mainfrom
charlie/share-attribute-write-checks

Conversation

@charliermarsh

@charliermarsh charliermarsh commented Sep 12, 2026 •

Copy link
Copy Markdown
Member

Summary

We move attribute-write compatibility checking from protocol_class.rs to attribute_write.rs, alongside the lookup and descriptor-setter helpers it uses. This makes the same write checks available to nominal attribute override validation.

Protocol checking continues to use the active type relation and constraints. Descriptor setters, Self binding, class and instance fallbacks, and terminal __setattr__ behavior are unchanged.

Part of astral-sh/ty#2158.

@charliermarsh charliermarsh added the ty The ty type checker label Sep 12, 2026
@astral-sh-bot

astral-sh-bot Bot commented Sep 12, 2026

Copy link
Copy Markdown

Typing conformance results

No changes detected ✅

Current numbers
The percentage of diagnostics emitted that were expected errors held steady at 97.84%. The percentage of expected errors that received a diagnostic held steady at 96.45%. The number of fully passing files held steady at 128/145.

@astral-sh-bot

astral-sh-bot Bot commented Sep 12, 2026

Copy link
Copy Markdown

Memory usage report

Memory usage unchanged ✅

@astral-sh-bot

astral-sh-bot Bot commented Sep 12, 2026 •

Copy link
Copy Markdown

ecosystem-analyzer results

No diagnostic changes detected ✅

Flaky changes detected. This PR summary excludes flaky changes; see the HTML report for details.

Full report with detailed diff (timing results)

@charliermarsh
charliermarsh force-pushed the charlie/share-attribute-write-checks branch from 56bde8f to cd3fc10 Compare September 12, 2026 20:58
@charliermarsh
charliermarsh added this pull request to stack #28558 September 12, 2026 20:59
@charliermarsh charliermarsh added the internal An internal refactor or improvement (not for changelogs) label Sep 12, 2026
@charliermarsh
charliermarsh force-pushed the charlie/share-attribute-write-checks branch 2 times, most recently from 80f8e34 to 9567718 Compare September 13, 2026 13:04
@charliermarsh
charliermarsh removed this pull request from stack #28558 September 13, 2026 13:06
@charliermarsh
charliermarsh changed the base branch from main to charlie/synthesized-match-args-classvar September 13, 2026 13:06
@charliermarsh
charliermarsh added this pull request to stack #28564 September 13, 2026 13:07
@charliermarsh
charliermarsh force-pushed the charlie/share-attribute-write-checks branch from 9567718 to e02da0d Compare September 13, 2026 13:59
@charliermarsh
charliermarsh removed this pull request from stack #28564 September 13, 2026 13:59
@charliermarsh
charliermarsh changed the base branch from charlie/synthesized-match-args-classvar to charlie/generic-property-setter-domains September 13, 2026 14:00
@charliermarsh
charliermarsh added this pull request to stack #28566 September 13, 2026 14:00
@charliermarsh
charliermarsh marked this pull request as ready for review September 14, 2026 13:34
@charliermarsh
charliermarsh requested a review from a team as a code owner September 14, 2026 13:34
@astral-sh-bot
astral-sh-bot Bot requested a review from dcreager September 14, 2026 13:34
@charliermarsh
charliermarsh requested review from AlexWaygood and removed request for dcreager September 14, 2026 13:34

@AlexWaygood AlexWaygood left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

(did not review in depth, I assume this is just moving code from one module to another, and that seems good!)

@charliermarsh
charliermarsh removed this pull request from stack #28566 September 14, 2026 14:10
@charliermarsh
charliermarsh changed the base branch from charlie/generic-property-setter-domains to main September 14, 2026 14:11
@charliermarsh
charliermarsh force-pushed the charlie/share-attribute-write-checks branch from e02da0d to 4f800d4 Compare September 14, 2026 14:12
@charliermarsh
charliermarsh added this pull request to stack #28576 September 14, 2026 14:12
@charliermarsh
charliermarsh merged commit c5b1960 into main Sep 14, 2026
71 checks passed
@charliermarsh
charliermarsh deleted the charlie/share-attribute-write-checks branch September 14, 2026 14:21
carljm added a commit that referenced this pull request Sep 14, 2026
…aliases

* origin/main: (21 commits)
  [ty] Share attribute write compatibility checks (#28555)
  [ty] Prefer `ty.toml` and `pyproject.toml` over playground `ty.json` (#28449)
  [`ruff`, `flake8-use-pathlib`] Support `parent_mode` (`RUF064`, `PTH103`) (#28528)
  [`pyupgrade`] Make the fix for `UP040` always unsafe (#28526)
  [`pyupgrade`] Skip `TypeVarTuple` and `ParamSpec` conversions with bounds or constraints (`UP040`, `UP046`, `UP047`) (#28505)
  [ty] Escape glob characters in anchored directory paths (#28518)
  [ty] Handle gradual metaclass ancestry and conflicts (#28474)
  [ty] Preserve recursive metadata in union transformations (#28497)
  [ty] Refactor "desperate" import resolution to use candidate operations that will also apply to module enumeration. (#28543)
  [ty] Report override conflicts introduced by new bases (#28530)
  [ty] Resolve dependencies within correlated inference alternatives (#28252)
  [ty] Extract shared abstract-method analysis (#28537)
  [ty] Reject reassignment of enum members (#28462)
  [ty] Preserve runtime comparison semantics when narrowing tagged unions (#28053)
  [ty] Extract a method on `NameResolver` to advance resolution by single module name component. (#28540)
  [ty] Return root discovery to `NameResolver`, but retain necessary interface changes (#28536)
  [ty] Default-specialize class objects in meta-protocol checks (#28265)
  [ty] Extract module root discovery from `NameResolver`. (#28531)
  [ty] Fix MRO ordering for generic bases (#28172)
  [ty] Run benchmarks for auto-imports in CI (#28490)
  ...

# Conflicts:
#	crates/ty_python_semantic/src/types/narrow.rs
@charliermarsh
charliermarsh restored the charlie/share-attribute-write-checks branch September 14, 2026 19:42
@charliermarsh
charliermarsh deleted the charlie/share-attribute-write-checks branch September 14, 2026 19:43
@charliermarsh
charliermarsh restored the charlie/share-attribute-write-checks branch September 14, 2026 19:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal An internal refactor or improvement (not for changelogs) ty The ty type checker

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants