Skip to content

Support type()'s functional syntax #740

@InSyncWithFoo

Description

@InSyncWithFoo

(First raised on Discord.)

Currently ty doesn't understand type()'s functional syntax very well (playground):

# error: Object of type `type` is not assignable to `type[int]`
U32: type[int] = type('U32', (int,), {})

It understands type(...) returns a new type, but fails to take the bases into account.

Metadata

Metadata

Assignees

No one assigned

    Labels

    runtime semanticsAccurate modeling of how Python's semantics work at runtime

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions