@@ -146,15 +146,15 @@ def __abs__(self: array, /) -> array:
146146 Added complex data type support.
147147 """
148148
149- def __add__ (self : array , other : Union [int , float , array ], / ) -> array :
149+ def __add__ (self : array , other : Union [int , float , complex , array ], / ) -> array :
150150 """
151151 Calculates the sum for each element of an array instance with the respective element of the array ``other``.
152152
153153 Parameters
154154 ----------
155155 self: array
156156 array instance (augend array). Should have a numeric data type.
157- other: Union[int, float, array]
157+ other: Union[int, float, complex, array]
158158 addend array. Must be compatible with ``self`` (see :ref:`broadcasting`). Should have a numeric data type.
159159
160160 Returns
@@ -374,15 +374,15 @@ def __dlpack_device__(self: array, /) -> Tuple[Enum, int]:
374374 ROCM = 10
375375 """
376376
377- def __eq__ (self : array , other : Union [int , float , bool , array ], / ) -> array :
377+ def __eq__ (self : array , other : Union [int , float , complex , bool , array ], / ) -> array :
378378 r"""
379379 Computes the truth value of ``self_i == other_i`` for each element of an array instance with the respective element of the array ``other``.
380380
381381 Parameters
382382 ----------
383383 self: array
384384 array instance. May have any data type.
385- other: Union[int, float, bool, array]
385+ other: Union[int, float, complex, bool, array]
386386 other array. Must be compatible with ``self`` (see :ref:`broadcasting`). May have any data type.
387387
388388 Returns
@@ -746,7 +746,7 @@ def __mod__(self: array, other: Union[int, float, array], /) -> array:
746746 Element-wise results, including special cases, must equal the results returned by the equivalent element-wise function :func:`~array_api.remainder`.
747747 """
748748
749- def __mul__ (self : array , other : Union [int , float , array ], / ) -> array :
749+ def __mul__ (self : array , other : Union [int , float , complex , array ], / ) -> array :
750750 r"""
751751 Calculates the product for each element of an array instance with the respective element of the array ``other``.
752752
@@ -757,7 +757,7 @@ def __mul__(self: array, other: Union[int, float, array], /) -> array:
757757 ----------
758758 self: array
759759 array instance. Should have a numeric data type.
760- other: Union[int, float, array]
760+ other: Union[int, float, complex, array]
761761 other array. Must be compatible with ``self`` (see :ref:`broadcasting`). Should have a numeric data type.
762762
763763 Returns
@@ -775,15 +775,15 @@ def __mul__(self: array, other: Union[int, float, array], /) -> array:
775775 Added complex data type support.
776776 """
777777
778- def __ne__ (self : array , other : Union [int , float , bool , array ], / ) -> array :
778+ def __ne__ (self : array , other : Union [int , float , complex , bool , array ], / ) -> array :
779779 """
780780 Computes the truth value of ``self_i != other_i`` for each element of an array instance with the respective element of the array ``other``.
781781
782782 Parameters
783783 ----------
784784 self: array
785785 array instance. May have any data type.
786- other: Union[int, float, bool, array]
786+ other: Union[int, float, complex, bool, array]
787787 other array. Must be compatible with ``self`` (see :ref:`broadcasting`). May have any data type.
788788
789789 Returns
@@ -852,9 +852,6 @@ def __or__(self: array, other: Union[int, bool, array], /) -> array:
852852
853853 .. note::
854854 Element-wise results must equal the results returned by the equivalent element-wise function :func:`~array_api.bitwise_or`.
855-
856- .. versionchanged:: 2022.12
857- Added complex data type support.
858855 """
859856
860857 def __pos__ (self : array , / ) -> array :
@@ -876,7 +873,7 @@ def __pos__(self: array, /) -> array:
876873 Element-wise results must equal the results returned by the equivalent element-wise function :func:`~array_api.positive`.
877874 """
878875
879- def __pow__ (self : array , other : Union [int , float , array ], / ) -> array :
876+ def __pow__ (self : array , other : Union [int , float , complex , array ], / ) -> array :
880877 r"""
881878 Calculates an implementation-dependent approximation of exponentiation by raising each element (the base) of an array instance to the power of ``other_i`` (the exponent), where ``other_i`` is the corresponding element of the array ``other``.
882879
@@ -889,7 +886,7 @@ def __pow__(self: array, other: Union[int, float, array], /) -> array:
889886 ----------
890887 self: array
891888 array instance whose elements correspond to the exponentiation base. Should have a numeric data type.
892- other: Union[int, float, array]
889+ other: Union[int, float, complex, array]
893890 other array whose elements correspond to the exponentiation exponent. Must be compatible with ``self`` (see :ref:`broadcasting`). Should have a numeric data type.
894891
895892 Returns
@@ -933,7 +930,7 @@ def __setitem__(
933930 key : Union [
934931 int , slice , ellipsis , Tuple [Union [int , slice , ellipsis ], ...], array
935932 ],
936- value : Union [int , float , bool , array ],
933+ value : Union [int , float , complex , bool , array ],
937934 / ,
938935 ) -> None :
939936 """
@@ -947,7 +944,7 @@ def __setitem__(
947944 array instance.
948945 key: Union[int, slice, ellipsis, Tuple[Union[int, slice, ellipsis], ...], array]
949946 index key.
950- value: Union[int, float, bool, array]
947+ value: Union[int, float, complex, bool, array]
951948 value(s) to set. Must be compatible with ``self[key]`` (see :ref:`broadcasting`).
952949
953950
@@ -960,7 +957,7 @@ def __setitem__(
960957 When ``value`` is an ``array`` of a different data type than ``self``, how values are cast to the data type of ``self`` is implementation defined.
961958 """
962959
963- def __sub__ (self : array , other : Union [int , float , array ], / ) -> array :
960+ def __sub__ (self : array , other : Union [int , float , complex , array ], / ) -> array :
964961 """
965962 Calculates the difference for each element of an array instance with the respective element of the array ``other``.
966963
@@ -970,7 +967,7 @@ def __sub__(self: array, other: Union[int, float, array], /) -> array:
970967 ----------
971968 self: array
972969 array instance (minuend array). Should have a numeric data type.
973- other: Union[int, float, array]
970+ other: Union[int, float, complex, array]
974971 subtrahend array. Must be compatible with ``self`` (see :ref:`broadcasting`). Should have a numeric data type.
975972
976973 Returns
@@ -988,7 +985,7 @@ def __sub__(self: array, other: Union[int, float, array], /) -> array:
988985 Added complex data type support.
989986 """
990987
991- def __truediv__ (self : array , other : Union [int , float , array ], / ) -> array :
988+ def __truediv__ (self : array , other : Union [int , float , complex , array ], / ) -> array :
992989 r"""
993990 Evaluates ``self_i / other_i`` for each element of an array instance with the respective element of the array ``other``.
994991
@@ -1001,7 +998,7 @@ def __truediv__(self: array, other: Union[int, float, array], /) -> array:
1001998 ----------
1002999 self: array
10031000 array instance. Should have a numeric data type.
1004- other: Union[int, float, array]
1001+ other: Union[int, float, complex, array]
10051002 other array. Must be compatible with ``self`` (see :ref:`broadcasting`). Should have a numeric data type.
10061003
10071004 Returns
0 commit comments