Skip to content

Binder: 'import androidx.compose.ui.Modifier' as a submodule shadows the proxy class #323

Closed

Description

@b-re-w

Found while designing #322. Once a key under androidx.compose.ui.Modifier.* exists, the name androidx.compose.ui.Modifier is also an object module; importing it as a submodule binds the module onto the parent package and can shadow the proxy class that 'from androidx.compose.ui import Modifier' returns. Not observed in a run; from reading _adapt (PythonxAdapter.kt ~2191-2223). Completion: a test importing both ways in both orders; the class stays the class (and the module's statics stay reachable through it).

Activity

  1. b-re-w commented on Oct 25, 2026

    @b-re-w
    MemberAuthor

    Partly addressed by #324: the proxy class now stays on its parent package when the proxy layer creates the same-named module (class wins unless a parent declaration of that name exists), in both install orders. Still open: an explicit 'import androidx.compose.ui.Modifier' by user code binds the module onto the parent through the import system itself; not tested.

  2. added a commit that references this issue on Oct 25, 2026
  3. b-re-w commented on Oct 25, 2026

    @b-re-w
    MemberAuthor

    Landed in develop via #326: the parent module guards setattr with class_wins_over_module; explicit imports keep the class.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions