Repository navigation
Feat: Reach snake_case methods on proxies the binder returns - #24
Merged
Merged
Conversation
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
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.
Closes #20
Registers pythonx's naming rule as the binder's member resolver (
python_multiplatform.binding.add_member_resolver, python-multiplatformba4c6f49).m.fill_max_width()now reachesfillMaxWidthon a proxy that Kotlin returned. The binder caches the alias in its own registry, so its class keeps Kotlin names indir(), 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
ba4c6f49before 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.ba4c6f49(sources exported read-only withgit show)tools/check_guide.py: 0 findings.