Repository navigation
fix(python): a call on an element of a collection links to the project's one method - #3175
Merged
Merged
Conversation
colbymchenry
force-pushed
the
claude/fix-objc-member-types
branch
from
November 1, 2026 05:10
841c605 to
6951c6c
Compare
…t's one method PR 1926 keeps a Python receiver's text, so that a bare name can't land on a list method. No strategy reads a subscript in that text, so `stats[i].write()` stopped linking at all, where 1.6.2 reached the project's method by name: rocksdb lost `cond1_trigger["col-fam-A"][0].get_message()`, entry lost/41 of the comparison. An element's call now takes the project's one method of the name, in the file's own module or one it imports, and not a name a list or a dict has, or a dunder. The rule is narrower than 1.6.2 on purpose, each limit from reading what a wider one added: - no word scoring: netbox's `context['object'].get_absolute_url()` is no `ConfigContext`, and `module_bays[1].clean()` no `ModuleTypeImportForm`; - the module in hand: netbox's `children[0].process_rhs()` is a Django lookup's, not a mixin's in a module its file never names; - nothing past the element: django's `connections[db].settings_dict.get()` is a dict's, whatever `MultiValueDict` shares with its name, and `tournaments[0].pool_set.all()` a manager's, not `QuerySet`'s. Those stay unlinked, as on main. Validation against main 4499d00: - Tests: 3 of 6 fail with the rule off, all pass. 5 mutations each fail a test. - rocksdb +14: the 4 `get_message`, `Policy`, `PolicyStats`, `MissRatioStats`, `CostClassEntry`, `BlockAccessTimeline`. django +36. netbox +3. All 53 read, all true, and 1.6.2's false `pop` and `values` stay out. - mealie, flask, redis, gin, leveldb: identical. - No extraction change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
colbymchenry
force-pushed
the
claude/fix-python-element-calls
branch
from
November 1, 2026 05:11
4908371 to
d679720
Compare
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.
Summary
A Python call on an element of a collection, like
stats[i].write_timeline(), links to the project's one method of that name again. rocksdb lostcond1_trigger["col-fam-A"][0].get_message(), entrylost/41of the comparison with 1.6.2.Last of a stack of four, on top of #3174.
Root cause
#1926 keeps a Python receiver's text, so that a bare name can't land on a list method. No strategy reads a subscript in that text, so these calls stopped linking at all.
The fix
An element's call takes the project's one method of the name, in the file's own module or one it imports, and not a name a list or a dict has, or a dunder.
This is narrower than 1.6.2 on purpose. Each limit comes from reading what a wider rule added:
context['object'].get_absolute_url()is noConfigContext, andmodule_bays[1].clean()noModuleTypeImportFormchildren[0].process_rhs()is a Django lookup's, not a mixin's in a module its file never namesconnections[db].settings_dict.get()is a dict's, andtournaments[0].pool_set.all()a manager'sSo a call 1.6.2 linked by name can stay unlinked where nothing in the file ties it to the class. That is the same choice #1926 made for attribute chains: a silent miss, never a wrong edge.
Validation
Windows 11, main 4499d00.
Tests. 3 of the 6 new tests fail with the rule off, and all pass. 5 mutations each fail a test.
A/B against main.
get_message,Policy,PolicyStats,MissRatioStats,CostClassEntry,BlockAccessTimelineAll 53 read against source, all true. 1.6.2's false
popandvaluesstay out.No extraction change. Cost. django, 3 interleaved rounds on a busy machine: CPU 88.6 to 83.7 s, level.
Suite. 857 files passed and 6 skipped, 10,651 tests passed, 2 expected fail, 87 skipped, 4 workers, with the kernel, on the stack one clean rebase back (719ea417 on main 3bd9949). After the rebase onto 087de4c, whose hunks are apart from these: 138 files and 2,224 tests of the C, C++, Objective-C, Python and extraction suites pass on the tip.
🤖 Generated with Claude Code