File tree 2 files changed +24
-17
lines changed
src/array_api_stubs/_draft
2 files changed +24
-17
lines changed Original file line number Diff line number Diff line change 24
24
25
25
if TYPE_CHECKING :
26
26
from .array_object import Array
27
+ from .data_types import DType
27
28
28
29
array = TypeVar ("array" , bound = "Array" )
29
30
device = TypeVar ("device" )
30
- dtype = TypeVar ("dtype" )
31
+ dtype = TypeVar ("dtype" , bound = "DType" )
31
32
SupportsDLPack = TypeVar ("SupportsDLPack" )
32
33
SupportsBufferProtocol = TypeVar ("SupportsBufferProtocol" )
33
34
PyCapsule = TypeVar ("PyCapsule" )
Original file line number Diff line number Diff line change 1
- from . _types import dtype
1
+ from typing import TYPE_CHECKING , Protocol
2
2
3
+ if TYPE_CHECKING :
4
+ from ._types import dtype
3
5
4
- def __eq__ (self : dtype , other : dtype , / ) -> bool :
5
- """
6
- Computes the truth value of ``self == other`` in order to test for data type object equality.
7
6
8
- Parameters
9
- ----------
10
- self: dtype
11
- data type instance. May be any supported data type.
12
- other: dtype
13
- other data type instance. May be any supported data type.
7
+ class DType (Protocol ):
14
8
15
- Returns
16
- -------
17
- out: bool
18
- a boolean indicating whether the data type objects are equal.
19
- """
9
+ def __eq__ (self : dtype , other : dtype , / ) -> bool :
10
+ """
11
+ Computes the truth value of ``self == other`` in order to test for data type object equality.
20
12
13
+ Parameters
14
+ ----------
15
+ self: dtype
16
+ data type instance. May be any supported data type.
17
+ other: dtype
18
+ other data type instance. May be any supported data type.
21
19
22
- __all__ = ["__eq__" ]
20
+ Returns
21
+ -------
22
+ out: bool
23
+ a boolean indicating whether the data type objects are equal.
24
+ """
25
+ ...
26
+
27
+
28
+ __all__ = ["DType" ]
You can’t perform that action at this time.
0 commit comments