Skip to content

new rule - ban dynamic types #3765

Closed
Closed

Description

@DetachHead

https://docs.astral.sh/ty/reference/rules/#unsupported-dynamic-base

def factory(base: type[Base]) -> type:
    # `base` has type `type[Base]`, not `type[Base]` itself
    return type("Dynamic", (base,), {})  # error: [unsupported-dynamic-base]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions