Skip to content

Feat: Reach snake_case methods on proxies the binder returns - #24

Merged
b-re-w merged 1 commit into
developfrom
work/member-names
Oct 2, 2026
Merged

b-re-w merged 1 commit into
developfrom
work/member-names

Conversation

@b-re-w

@b-re-w b-re-w commented Oct 2, 2026

Copy link
Copy Markdown
Member

Closes #20

Registers pythonx's naming rule as the binder's member resolver (python_multiplatform.binding.add_member_resolver, python-multiplatform ba4c6f49). m.fill_max_width() now reaches fillMaxWidth on a proxy that Kotlin returned. The binder caches the alias in its own registry, so its class keeps Kotlin names in dir(), and a new test pins that.

Feature added: resolver registration, done once per binding layer alongside the value-class allowlist.
Test added: test_a_resolved_snake_case_method_leaves_the_binders_class_kotlin_named.
Red: against ba4c6f49 before this change, the 4 tests that used to skip ran and failed. Unregistering the resolver fails 5.
Documentation corrected: SPEC §0/§3/S4.1/S6.1/S6.4, PROJECT.md, AGENTS.md §14, guide.
Gap recorded: a method's keyword arguments are still Kotlin's (m.padding(paddingValues=...)), because the resolver maps names, not keywords.

Environment Before After
python-multiplatform ba4c6f49 (sources exported read-only with git show) 92 passed, 4 failed 97 passed
older sibling checkout 92 passed, 4 skipped 92 passed, 5 skipped
no checkout 50 passed, 46 skipped 50 passed, 47 skipped

tools/check_guide.py: 0 findings.

m.fill_max_width() on a Modifier Kotlin handed back is an attribute of the
binder's own proxy class, which resolves Kotlin names only, so the module rule
could not reach it. python-multiplatform ba4c6f49 added
python_multiplatform.binding.add_member_resolver; the re-export layer now
registers the same naming rule there (member_name), once per binding layer,
alongside the value-class allowlist. The binder caches each alias in its own
registry, so its class keeps Kotlin names in dir() -- which a new test pins.

On an older binder without the hook nothing changes and the five tests that
need it skip, saying why. Keyword arguments to such a method are still
Kotlin's (m.padding(paddingValues=...)): the resolver maps names, not
keywords, and that is recorded in SPEC section 3 and S4.1.

feature added: the member resolver registration.
test added: test_a_resolved_snake_case_method_leaves_the_binders_class_kotlin_named.
Red: against python-multiplatform ba4c6f49 before this change, the 4 tests that
used to skip ran and failed. Unregistering the resolver fails 5.
documentation corrected: SPEC 0/3/S4.1/S6.1/S6.4, PROJECT.md, AGENTS.md
section 14, guide status and baseline.
Suite against python-multiplatform ba4c6f49 (sources exported read-only with
git show): 92 passed, 4 failed -> 97 passed. Against the older sibling
checkout: 92 passed, 5 skipped. Without a checkout: 50 passed, 47 skipped.
check_guide.py: 0.

Refs #20
@b-re-w
b-re-w merged commit 8e21018 into develop Oct 2, 2026
@b-re-w
b-re-w deleted the work/member-names branch October 3, 2026 10:20
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