You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Binder: a public companion object is reachable from Python as a value (Owner.Companion) #322
Context: Card(modifier=Modifier) still fails in real Compose (pythonx-compose SPEC S6.2 partial). Kotlin's empty Modifier is the companion object Modifier.Companion itself, and the binder never binds a companion instance (only its members: Owner.prop is called as Owner.Companion.prop). So pythonx-compose has nothing to hand to register_empty (#308).
Generic feature, no Compose name in the binder: a Kotlin-public companion object of a public class becomes a value from Python, reached by its Kotlin name (Owner.Companion, or the companion's own name if it has one). The generated Kotlin source names the companion and kotlinc compiles it to GETSTATIC Owner.Companion (no JVM name lookup, rule 12.4).
Completion: SPEC item; walker and runtime tests; Modifier.Companion from Python is a Modifier and works as an argument (e.g. register_empty(Modifier, lambda: Modifier.Companion) then Card(modifier=Modifier) renders), red before. Design is reported to the coordinator before implementation (adds public Python meaning).
Landed in develop via #324. pythonx-compose can now call register_empty(Modifier, lambda: Modifier.Companion); Card(modifier=Modifier) renders the same as Card(...) in the compose fixture.
Activity
Merge pull request #324 from thisisthepy/feat/binder-companion-value
b-re-w commentedon Oct 25, 2026
Landed in develop via #324. pythonx-compose can now call register_empty(Modifier, lambda: Modifier.Companion); Card(modifier=Modifier) renders the same as Card(...) in the compose fixture.