Skip to content

TYP: create and use ArrayNamespace type alias #112

@lucascolley

Description

@lucascolley
Member

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @lucascolley

        Issue actions

          TYP: create and use `ArrayNamespace` type alias · Issue #112 · data-apis/array-api-extra