Skip to content

Commit ac2cb73

Browse files
committed
asarray
1 parent 082c052 commit ac2cb73

File tree

3 files changed

+3
-27
lines changed

3 files changed

+3
-27
lines changed

array_api_compat/cupy/_aliases.py

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

6767
# asarray also adds the copy keyword, which is not present in numpy 1.0.
6868
def asarray(
69-
obj: Union[
70-
Array,
71-
bool,
72-
int,
73-
float,
74-
complex,
75-
NestedSequence[bool | int | float | complex],
76-
SupportsBufferProtocol,
77-
],
69+
obj: bool | complex | NestedSequence[bool | complex] | SupportsBufferProtocol,
7870
/,
7971
*,
8072
dtype: Optional[DType] = None,

array_api_compat/dask/array/_aliases.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -135,15 +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: Union[
139-
Array,
140-
bool,
141-
int,
142-
float,
143-
complex,
144-
NestedSequence[bool | int | float | complex],
145-
SupportsBufferProtocol,
146-
],
138+
obj: bool | complex | NestedSequence[bool | complex] | SupportsBufferProtocol,
147139
/,
148140
*,
149141
dtype: Optional[DType] = None,

array_api_compat/numpy/_aliases.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -73,15 +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: Union[
77-
Array,
78-
bool,
79-
int,
80-
float,
81-
complex,
82-
NestedSequence[bool | int | float | complex],
83-
SupportsBufferProtocol,
84-
],
76+
obj: bool | complex | NestedSequence[bool | complex] | SupportsBufferProtocol,
8577
/,
8678
*,
8779
dtype: Optional[DType] = None,

0 commit comments

Comments
 (0)