Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions array_api_compat/common/_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

if TYPE_CHECKING:
from typing import Optional, Union, Any
from ._typing import Array, Device
from ._typing import Array, Device, Namespace

import sys
import math
Expand Down Expand Up @@ -439,7 +439,7 @@ def _check_api_version(api_version: str) -> None:
raise ValueError("Only the 2023.12 version of the array API specification is currently supported")


def array_namespace(*xs, api_version=None, use_compat=None):
def array_namespace(*xs, api_version=None, use_compat=None) -> Namespace:
"""
Get the array API compatible namespace for the arrays `xs`.

Expand Down
2 changes: 2 additions & 0 deletions array_api_compat/common/_typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"SupportsBufferProtocol",
]

from types import ModuleType
from typing import (
Any,
TypeVar,
Expand All @@ -22,3 +23,4 @@ def __len__(self, /) -> int: ...
Array = Any
Device = Any
DType = Any
Namespace = ModuleType
Empty file added array_api_compat/py.typed
Empty file.
3 changes: 3 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,7 @@
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
],
package_data={
"array_api_compat": ["py.typed"],
},
)
Loading