Skip to content

Commit 0adac27

Browse files
committed
bool is a subclass of int
1 parent a213ab5 commit 0adac27

File tree

5 files changed

+7
-10
lines changed

5 files changed

+7
-10
lines changed

array_api_compat/common/_aliases.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def eye(
6767

6868
def full(
6969
shape: Union[int, Tuple[int, ...]],
70-
fill_value: bool | complex,
70+
fill_value: complex,
7171
xp: Namespace,
7272
*,
7373
dtype: Optional[DType] = None,
@@ -80,7 +80,7 @@ def full(
8080
def full_like(
8181
x: Array,
8282
/,
83-
fill_value: bool | complex,
83+
fill_value: complex,
8484
*,
8585
xp: Namespace,
8686
dtype: Optional[DType] = None,

array_api_compat/cupy/_aliases.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,7 @@
6666

6767
# asarray also adds the copy keyword, which is not present in numpy 1.0.
6868
def asarray(
69-
obj: Array | bool | complex | NestedSequence[bool | complex]
70-
| SupportsBufferProtocol,
69+
obj: Array | complex | NestedSequence[complex] | SupportsBufferProtocol,
7170
/,
7271
*,
7372
dtype: Optional[DType] = None,

array_api_compat/dask/array/_aliases.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,7 @@ def arange(
135135

136136
# asarray also adds the copy keyword, which is not present in numpy 1.0.
137137
def asarray(
138-
obj: Array | bool | complex | NestedSequence[bool | complex]
139-
| SupportsBufferProtocol,
138+
obj: Array | complex | NestedSequence[complex] | SupportsBufferProtocol,
140139
/,
141140
*,
142141
dtype: Optional[DType] = None,

array_api_compat/numpy/_aliases.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,7 @@ def _supports_buffer_protocol(obj):
7373
# complicated enough that it's easier to define it separately for each module
7474
# rather than trying to combine everything into one function in common/
7575
def asarray(
76-
obj: Array | bool | complex | NestedSequence[bool | complex]
77-
| SupportsBufferProtocol,
76+
obj: Array | complex | NestedSequence[complex] | SupportsBufferProtocol,
7877
/,
7978
*,
8079
dtype: Optional[DType] = None,

array_api_compat/torch/_aliases.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ def _fix_promotion(x1, x2, only_scalar=True):
116116
_py_scalars = (bool, int, float, complex)
117117

118118

119-
def result_type(*arrays_and_dtypes: Array | DType | bool | complex) -> DType:
119+
def result_type(*arrays_and_dtypes: Array | DType | complex) -> DType:
120120
if len(arrays_and_dtypes) == 0:
121121
raise TypeError("At least one array or dtype must be provided")
122122
if len(arrays_and_dtypes) == 1:
@@ -602,7 +602,7 @@ def linspace(start: Union[int, float],
602602
# torch.full does not accept an int size
603603
# https://github.com/pytorch/pytorch/issues/70906
604604
def full(shape: Union[int, Tuple[int, ...]],
605-
fill_value: bool | complex,
605+
fill_value: complex,
606606
*,
607607
dtype: Optional[DType] = None,
608608
device: Optional[Device] = None,

0 commit comments

Comments
 (0)