Skip to content

fix(python): a call on an element of a collection links to the project's one method - #3175

Merged
colbymchenry merged 1 commit into
mainfrom
claude/fix-python-element-calls
Nov 1, 2026
Merged

colbymchenry merged 1 commit into
mainfrom
claude/fix-python-element-calls

Conversation

@colbymchenry

Copy link
Copy Markdown
Owner

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 lost cond1_trigger["col-fam-A"][0].get_message(), entry lost/41 of 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:

Limit What it keeps out
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, and tournaments[0].pool_set.all() a manager's

So 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.

Repo Result
rocksdb +14: the 4 get_message, Policy, PolicyStats, MissRatioStats, CostClassEntry, BlockAccessTimeline
django +36
netbox +3
mealie, flask, redis identical
gin, leveldb controls, identical

All 53 read against source, all true. 1.6.2's false pop and values stay 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

@colbymchenry
colbymchenry force-pushed the claude/fix-objc-member-types branch from 841c605 to 6951c6c Compare November 1, 2026 05:10
Base automatically changed from claude/fix-objc-member-types to main November 1, 2026 05:11
…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
colbymchenry force-pushed the claude/fix-python-element-calls branch from 4908371 to d679720 Compare November 1, 2026 05:11
@colbymchenry
colbymchenry merged commit 9191ab6 into main Nov 1, 2026
@colbymchenry
colbymchenry deleted the claude/fix-python-element-calls branch November 1, 2026 05:11
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.

1 participant