File tree Expand file tree Collapse file tree 2 files changed +16
-5
lines changed Expand file tree Collapse file tree 2 files changed +16
-5
lines changed Original file line number Diff line number Diff line change 1
1
"""Static typing support for the array API standard."""
2
2
3
3
__all__ = (
4
+ "Array" ,
4
5
"HasArrayNamespace" ,
5
6
"__version__" ,
6
7
"__version_tuple__" ,
7
8
)
8
9
9
- from ._array import HasArrayNamespace
10
+ from ._array import Array , HasArrayNamespace
10
11
from ._version import version as __version__ , version_tuple as __version_tuple__
Original file line number Diff line number Diff line change 1
- __all__ = ("HasArrayNamespace" ,)
1
+ __all__ = (
2
+ "Array" ,
3
+ "HasArrayNamespace" ,
4
+ )
2
5
3
6
from types import ModuleType
4
7
from typing import Literal , Protocol
5
8
from typing_extensions import TypeVar
6
9
7
- T_co = TypeVar ("T_co " , covariant = True , default = ModuleType )
10
+ NS_co = TypeVar ("NS_co " , covariant = True , default = ModuleType )
8
11
9
12
10
- class HasArrayNamespace (Protocol [T_co ]):
13
+ class HasArrayNamespace (Protocol [NS_co ]):
11
14
"""Protocol for classes that have an `__array_namespace__` method.
12
15
13
16
Example:
@@ -27,4 +30,11 @@ class HasArrayNamespace(Protocol[T_co]):
27
30
28
31
def __array_namespace__ (
29
32
self , / , * , api_version : Literal ["2021.12" ] | None = None
30
- ) -> T_co : ...
33
+ ) -> NS_co : ...
34
+
35
+
36
+ class Array (
37
+ HasArrayNamespace [NS_co ],
38
+ Protocol [NS_co ],
39
+ ):
40
+ """Array API specification for array object attributes and methods."""
You can’t perform that action at this time.
0 commit comments