Skip to content

Add type hints / annotations to array_namespace(): array_api_strict as return type? #194

@34j

Description

@34j

Without type hints, it is very inconvenient because of spelling errors of array_api functions. As array_api_compat seems to be a superset of array_api_strict, I would like to propose to simply set the return type of array_namespace() to array_api_strict, although it might be confusing.

def array_namespace(*xs, api_version=None, use_compat=None):

from typing import overload
import array_api_strict

array_api_compat_type = array_api_strict

@overload
def array_namespace(*xs, api_version=None, use_compat: None=None) -> array_api_compat_type:
	...

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy