Skip to content

Runtime: install the compiled builtin when the interpreter starts #42

Closed

Description

@b-re-w

What

The maintainer wants @compiled to be a builtin name that needs no import: "파이썬 멀티플랫폼에서는 해당 데코레이터가 기본 키워드가 되도록 할 거니까 특정 패키지 아래로 넣지 마". When python-multiplatform initialises the embedded interpreter, it sets builtins.compiled to an identity decorator. The TypedPython compiler picks out the decorated functions at build time, so at run time the decorator does nothing.

Why

User code must not import a TypedPython package to mark compiled code. On plain CPython the same name comes from a development shim that the typedpython wheel installs (a .pth). The gate learns about it from a __builtins__.pyi extension stub.

Owner

The leader implements this, since it is on the binder initialisation path. TypedPython supplies the shim and the stub.

Done when

A test on each platform: after interpreter initialisation, compiled resolves without an import, and compiled(f) is f holds.

Activity

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

    @b-re-w
    MemberAuthor

    Landed in develop via #62.

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