Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TYP: change type annotation for __array_namespace__ to ModuleType #20725

Merged
merged 1 commit into from Jan 4, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion numpy/array_api/_array_object.py
Expand Up @@ -30,6 +30,7 @@
)

from typing import TYPE_CHECKING, Optional, Tuple, Union, Any
import types

if TYPE_CHECKING:
from ._typing import Any, PyCapsule, Device, Dtype
Expand Down Expand Up @@ -415,7 +416,7 @@ def __and__(self: Array, other: Union[int, bool, Array], /) -> Array:

def __array_namespace__(
self: Array, /, *, api_version: Optional[str] = None
) -> Any:
) -> types.ModuleType:
if api_version is not None and not api_version.startswith("2021."):
raise ValueError(f"Unrecognized array API version: {api_version!r}")
return array_api
Expand Down