Skip to content

Commit fb00a59

Browse files
committed
šŸ› fix HasArrayNamespace falsely rejecting ndarray instances on numpy 2
1 parent f01a4c1 commit fb00a59

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

ā€Žsrc/array_api_typing/_namespace.py

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

33
from types import ModuleType
4-
from typing import Protocol
4+
from typing import Literal, Protocol
55
from typing_extensions import TypeVar
66

77
T_co = TypeVar("T_co", covariant=True, default=ModuleType)
@@ -25,4 +25,6 @@ class HasArrayNamespace(Protocol[T_co]):
2525
2626
"""
2727

28-
def __array_namespace__(self, /, *, api_version: str | None = None) -> T_co: ...
28+
def __array_namespace__(
29+
self, /, *, api_version: Literal["2021.12"] | None = None
30+
) -> T_co: ...

0 commit comments

Comments
Ā (0)