File tree Expand file tree Collapse file tree 2 files changed +24
-17
lines changed
src/array_api_stubs/_draft Expand file tree Collapse file tree 2 files changed +24
-17
lines changed Original file line number Diff line number Diff line change 2424
2525if TYPE_CHECKING :
2626 from .array_object import Array
27+ from .data_types import DType
2728
2829array = TypeVar ("array" , bound = "Array" )
2930device = TypeVar ("device" )
30- dtype = TypeVar ("dtype" )
31+ dtype = TypeVar ("dtype" , bound = "DType" )
3132SupportsDLPack = TypeVar ("SupportsDLPack" )
3233SupportsBufferProtocol = TypeVar ("SupportsBufferProtocol" )
3334PyCapsule = TypeVar ("PyCapsule" )
Original file line number Diff line number Diff line change 1- from . _types import dtype
1+ from typing import TYPE_CHECKING , Protocol
22
3+ if TYPE_CHECKING :
4+ from ._types import dtype
35
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.
76
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 ):
148
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.
2012
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.
2119
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