Skip to content

Latest commit

 

History

History
58 lines (41 loc) · 1.09 KB

File metadata and controls

58 lines (41 loc) · 1.09 KB

array-api-typing

Type Annotations for the Python array API standard


Warning

This package is in early development and is not yet stable. It is intended as a typing toolkit for working with the Python array API standard, but it may change significantly in the future.

Installation

pip install array-api-typing
using uv
uv add array-api-typing
from source, using pip
pip install git+https://github.com/data-apis/array-api-typing.git
building from source
cd /path/to/parent
git clone https://github.com/data-apis/array-api-typing.git
cd array-api-typing
pip install -e .  # editable mode

Quick example

>>> import array_api_typing as xpt
>>> import numpy as np

>>> def func(x: xpt.HasArrayNamespace) -> xpt.HasArrayNamespace:
...    return x

>>> func(np.array([1, 2, 3]))
array([1, 2, 3])