Skip to content

TypedPython: fixed-layout classes (SPEC N-11, M2b) #123

Closed

Description

@b-re-w

Compile classes whose layout is fixed in CPython too (user-written __slots__ equal to the annotated fields, base object, trivial __init__): slot reads/writes, allocate-and-fill construction, is/None, class-typed parameters. Same results as the interpreter, including when the class or its module global changes after init.

Done when: binary-trees' make and check compile with Node declaring __slots__, outputs agree with CPython/Node/Java/Rust, the TypedPython suite passes, and the class-change scenarios (property installed after init, global rebinding, mid-body changes, watcher exhaustion) equal the interpreted module. Benchmark records CPython with and without __slots__.

Activity

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

    @b-re-w
    MemberAuthor

    Landed in develop via #124.

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