Repository navigation
named_attribute: exempt probes that restate no declaration of the scan's - #477
Merged
Merged
Conversation
named_attribute now skips seven shapes where no declaration of ours can hold the probe: stdlib callable metadata (__qualname__, __name__, an inspected partial's func), a standard-library object bound in the function, a dunder protocol, a module from import_module, an initialization or misuse guard, a setattr that is a lambda's body, and the open fallback of an isinstance decoder (only where the isinstance said no). Markers our own decorators set on functions stay findings. An exempt probe is never absent_attribute_probe's either; both detectors keep the one shared context builder. Bench counts at origin/main before #475: agent-comms 5 -> 1, toad 28 -> 27, textual 40 -> 23. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016gZLduhisRHdamZ5LNK72Z
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Numbers (measured on the mains before #475):
named_attribute73 → 51 across the three benches (agent-comms 5 → 1, toad 28 → 27, textual 40 → 23).What changed
AttributeProbeExemptionit matches.named_attributeskips exempt sites, and so doesabsent_attribute_probe(Report attribute probes that never succeed #475).__qualname__,__name__, a partial'sfunc/args/keywords) on a receiver the same function checks withcallable/inspect;iteroropen;import_module;hasattron self inside__repr__/__rich_repr__/__str__, or a test whose body only raises or warns);setattrthat is a lambda's whole body;isinstanceon the receiver said no (a lateroroperand, theelsebranch, or after anif isinstance(...)that returns, raises, breaks or continues)._height_dependency), since every reader restates the decorator's fact;isinstancethat said yes (textual/_animator.py:442), which is a declarable contract.Evidence
named_attribute.test_restated_fact_detectors,test_repository_architecture,test_class_mro,test_declared_receivers,test_type_only_readers.-k test_repository_: 72 passed.Generated by Claude Code