From ac20ed54e78e148468d59691d4b9313261859e3a Mon Sep 17 00:00:00 2001 From: 34j <34j.github@proton.me> Date: Sun, 24 Nov 2024 19:13:01 +0900 Subject: [PATCH] fix: export array --- spec/draft/API_specification/array_object.rst | 2 +- src/array_api_stubs/_draft/_types.py | 5 +++-- src/array_api_stubs/_draft/array_object.py | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/spec/draft/API_specification/array_object.rst b/spec/draft/API_specification/array_object.rst index a3694d14c..3516f0e98 100644 --- a/spec/draft/API_specification/array_object.rst +++ b/spec/draft/API_specification/array_object.rst @@ -275,7 +275,7 @@ Methods Array.__abs__ Array.__add__ Array.__and__ - Array.__Array_namespace__ + Array.__array_namespace__ Array.__bool__ Array.__complex__ Array.__dlpack__ diff --git a/src/array_api_stubs/_draft/_types.py b/src/array_api_stubs/_draft/_types.py index 9687c196a..18b72a98e 100644 --- a/src/array_api_stubs/_draft/_types.py +++ b/src/array_api_stubs/_draft/_types.py @@ -19,6 +19,7 @@ "Union", "Sequence", "array", + "Array", "device", "dtype", "ellipsis", @@ -46,7 +47,7 @@ from enum import Enum from .data_types import DType -array = TypeVar("array", bound="_array") +array = TypeVar("array", bound="Array") device = TypeVar("device") dtype = TypeVar("dtype", bound=DType) device_ = TypeVar("device_") # only used in this file @@ -149,7 +150,7 @@ def dtypes( ) -class _array(Protocol[array, dtype_, device_, PyCapsule]): # type: ignore +class Array(Protocol[array, dtype_, device_, PyCapsule]): # type: ignore def __init__(self: array) -> None: """Initialize the attributes for the array object class.""" diff --git a/src/array_api_stubs/_draft/array_object.py b/src/array_api_stubs/_draft/array_object.py index 3c3398e84..482df30ab 100644 --- a/src/array_api_stubs/_draft/array_object.py +++ b/src/array_api_stubs/_draft/array_object.py @@ -1,3 +1,3 @@ -from ._types import array +from ._types import array, Array -__all__ = ["array"] +__all__ = ["array", "Array"]