Skip to content

FamilyFlattened: admit cached_property identity projections - #158

Merged
trissim merged 1 commit into
mainfrom
fix/identity-return-cached-property
Oct 30, 2026
Merged

trissim merged 1 commit into
mainfrom
fix/identity-return-cached-property

Conversation

@trissim

@trissim trissim commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

FamilyFlattened.identity_return accepted only property (bare, from builtins import, or builtins.property). A functools.cached_property whose body is return self.value.declared_name is the same declaration-identity projection, but it was counted as name transport. This is the false positive on agent-comms #3589 (FamilyText.summary, disclosure_text.py), which order P930 edit 9 assigns to root.

Change:

  • FamilyFlattened.descriptors declares the recognized descriptors once, as (module, name) pairs: builtins.property and functools.cached_property.
  • from M import name [as alias] and import M [as alias] both resolve through that set. Shadowed names are still refused, using the existing write-count rule.
  • The test test_identity_projection_is_not_string_redispatch gains the from functools import cached_property and functools.cached_property spellings.

Checked (not pytest) on the #3589 disclosure_text.py: 0 sites, down from 1. The aliased ft.cached_property counts 0. A shadowed cached_property = f still counts 1.

🤖 Generated with Claude Code

A cached_property returning its receiver's declared_name projects declaration
identity exactly like a property; only the descriptor spelling differed. The
recognized standard-library descriptors are now one declared set, read for
bare imports and module-qualified decorators alike.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 30, 2026 06:37

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@trissim
trissim enabled auto-merge October 30, 2026 06:40
@trissim
trissim merged commit d0667af into main Oct 30, 2026
11 checks passed
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