Skip to content

[red-knot] understand equivalence of specialized generic classes #17432

@carljm

Description

@carljm

Observed by @cake-monotone in #17174 (comment)

from knot_extensions import is_subtype_of, static_assert

class A[T]:
    pass

class B(A[int]):
    pass

static_assert(is_subtype_of(B, A[int]))  # fails, but should pass

Playground

Metadata

Metadata

Assignees

No one assigned

    Labels

    tyMulti-file analysis & type inference

    Type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions