Skip to content

test_can_cast should not disallow cross-kind casting #151

Closed
@asmeurer

Description

@asmeurer

test_can_cast currently fails with NumPy because NumPy allows cross-kind casting. However, the spec only says that mixed-kind casting is undefined (https://data-apis.org/array-api/latest/API_specification/type_promotion.html), and can_cast just says it should follow the type promotion rules (https://data-apis.org/array-api/latest/API_specification/generated/signatures.data_type_functions.can_cast.html). So it should not test this case. If anything, it should check that if can_cast does return True for a mixed-kind cast, that such a cast is actually allowed on an array of that dtype.

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