Skip to content

TYP: create and use ArrayNamespace type alias #112

Open
@lucascolley

Description

@lucascolley

Throughout the codebase we annotate array namespace parameters (usually called xp) as ModuleType. We hope to narrow this type to something like ArrayNamespace when a protocol is developed in https://github.com/data-apis/array-api-typing.

For now, it would be good to add an ArrayNamespace = ModuleType alias at

# To be changed to a Protocol later (see data-apis/array-api#589)
Array = Any # type: ignore[no-any-explicit]
Device = Any # type: ignore[no-any-explicit]
Index = Any # type: ignore[no-any-explicit]

and use it throughout the codebase.

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions