Skip to content

Commit 10dfe43

Browse files
committed
✨: add Array class definition
Signed-off-by: Nathaniel Starkman <[email protected]>
1 parent 9185997 commit 10dfe43

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

src/array_api_typing/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
"""Static typing support for the array API standard."""
22

33
__all__ = (
4+
"Array",
45
"HasArrayNamespace",
56
"__version__",
67
"__version_tuple__",
78
)
89

9-
from ._array import HasArrayNamespace
10+
from ._array import Array, HasArrayNamespace
1011
from ._version import version as __version__, version_tuple as __version_tuple__

src/array_api_typing/_array.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
__all__ = ("HasArrayNamespace",)
1+
__all__ = (
2+
"Array",
3+
"HasArrayNamespace",
4+
)
25

36
from types import ModuleType
47
from typing import Protocol
@@ -26,3 +29,10 @@ class HasArrayNamespace(Protocol[T_co]):
2629
"""
2730

2831
def __array_namespace__(self, /, *, api_version: str | None = None) -> T_co: ... # noqa: PLW3201
32+
33+
34+
class Array(
35+
HasArrayNamespace[T_co],
36+
Protocol,
37+
):
38+
"""Array API specification for array object attributes and methods."""

0 commit comments

Comments
 (0)