Skip to content

Stubs: emit proxy classes with typed members instead of int handles #31

Closed

Description

@b-re-w

Kotlin-name stubs today annotate every object as int (e.g. def fillMaxWidth(receiver: int, /, fraction: float = ...) -> int), which gives an IDE nothing to complete. pythonx-compose's Pythonic stubs (thisisthepy/pythonx-compose#12) are derived from these, so the type information has to come from the binder, which is where it lives.

Scope (Kotlin names only, as everywhere in the binder):

  • one stub class per bound Kotlin type (class Modifier: ...), used in annotations instead of int;
  • extension functions also emitted as methods on their receiver's stub class (the runtime already serves them there);
  • value classes per the binder's rules; function types as Callable[...];
  • overload sets in the binder's _Overloads resolution order.

Completion: for real Compose 1.11.1 jars the stubs type-check a small consumer with mypy (Modifier chain, Checkbox, Text), and a test compares stub signatures to runtime inspect.signature for a sample of declarations.

Activity

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

    @b-re-w
    MemberAuthor

    Landed in develop via #43.

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