@@ -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
@@ -393,6 +393,9 @@ def __eq__(self: array, other: Union[int, float, bool, array], /) -> array:
393393
394394 .. note::
395395 Element-wise results, including special cases, must equal the results returned by the equivalent element-wise function :func:`~array_api.equal`.
396+
397+ .. versionchanged:: 2022.12
398+ Added complex data type support.
396399 """
397400
398401 def __float__ (self : array , / ) -> float :
@@ -746,7 +749,7 @@ def __mod__(self: array, other: Union[int, float, array], /) -> array:
746749 Element-wise results, including special cases, must equal the results returned by the equivalent element-wise function :func:`~array_api.remainder`.
747750 """
748751
749- def __mul__ (self : array , other : Union [int , float , array ], / ) -> array :
752+ def __mul__ (self : array , other : Union [int , float , complex , array ], / ) -> array :
750753 r"""
751754 Calculates the product for each element of an array instance with the respective element of the array ``other``.
752755
@@ -757,7 +760,7 @@ def __mul__(self: array, other: Union[int, float, array], /) -> array:
757760 ----------
758761 self: array
759762 array instance. Should have a numeric data type.
760- other: Union[int, float, array]
763+ other: Union[int, float, complex, array]
761764 other array. Must be compatible with ``self`` (see :ref:`broadcasting`). Should have a numeric data type.
762765
763766 Returns
@@ -775,15 +778,15 @@ def __mul__(self: array, other: Union[int, float, array], /) -> array:
775778 Added complex data type support.
776779 """
777780
778- def __ne__ (self : array , other : Union [int , float , bool , array ], / ) -> array :
781+ def __ne__ (self : array , other : Union [int , float , complex , bool , array ], / ) -> array :
779782 """
780783 Computes the truth value of ``self_i != other_i`` for each element of an array instance with the respective element of the array ``other``.
781784
782785 Parameters
783786 ----------
784787 self: array
785788 array instance. May have any data type.
786- other: Union[int, float, bool, array]
789+ other: Union[int, float, complex, bool, array]
787790 other array. Must be compatible with ``self`` (see :ref:`broadcasting`). May have any data type.
788791
789792 Returns
@@ -852,9 +855,6 @@ def __or__(self: array, other: Union[int, bool, array], /) -> array:
852855
853856 .. note::
854857 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.
858858 """
859859
860860 def __pos__ (self : array , / ) -> array :
@@ -876,7 +876,7 @@ def __pos__(self: array, /) -> array:
876876 Element-wise results must equal the results returned by the equivalent element-wise function :func:`~array_api.positive`.
877877 """
878878
879- def __pow__ (self : array , other : Union [int , float , array ], / ) -> array :
879+ def __pow__ (self : array , other : Union [int , float , complex , array ], / ) -> array :
880880 r"""
881881 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``.
882882
@@ -889,7 +889,7 @@ def __pow__(self: array, other: Union[int, float, array], /) -> array:
889889 ----------
890890 self: array
891891 array instance whose elements correspond to the exponentiation base. Should have a numeric data type.
892- other: Union[int, float, array]
892+ other: Union[int, float, complex, array]
893893 other array whose elements correspond to the exponentiation exponent. Must be compatible with ``self`` (see :ref:`broadcasting`). Should have a numeric data type.
894894
895895 Returns
@@ -933,7 +933,7 @@ def __setitem__(
933933 key : Union [
934934 int , slice , ellipsis , Tuple [Union [int , slice , ellipsis ], ...], array
935935 ],
936- value : Union [int , float , bool , array ],
936+ value : Union [int , float , complex , bool , array ],
937937 / ,
938938 ) -> None :
939939 """
@@ -947,7 +947,7 @@ def __setitem__(
947947 array instance.
948948 key: Union[int, slice, ellipsis, Tuple[Union[int, slice, ellipsis], ...], array]
949949 index key.
950- value: Union[int, float, bool, array]
950+ value: Union[int, float, complex, bool, array]
951951 value(s) to set. Must be compatible with ``self[key]`` (see :ref:`broadcasting`).
952952
953953
@@ -960,7 +960,7 @@ def __setitem__(
960960 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.
961961 """
962962
963- def __sub__ (self : array , other : Union [int , float , array ], / ) -> array :
963+ def __sub__ (self : array , other : Union [int , float , complex , array ], / ) -> array :
964964 """
965965 Calculates the difference for each element of an array instance with the respective element of the array ``other``.
966966
@@ -970,7 +970,7 @@ def __sub__(self: array, other: Union[int, float, array], /) -> array:
970970 ----------
971971 self: array
972972 array instance (minuend array). Should have a numeric data type.
973- other: Union[int, float, array]
973+ other: Union[int, float, complex, array]
974974 subtrahend array. Must be compatible with ``self`` (see :ref:`broadcasting`). Should have a numeric data type.
975975
976976 Returns
@@ -988,7 +988,7 @@ def __sub__(self: array, other: Union[int, float, array], /) -> array:
988988 Added complex data type support.
989989 """
990990
991- def __truediv__ (self : array , other : Union [int , float , array ], / ) -> array :
991+ def __truediv__ (self : array , other : Union [int , float , complex , array ], / ) -> array :
992992 r"""
993993 Evaluates ``self_i / other_i`` for each element of an array instance with the respective element of the array ``other``.
994994
@@ -1001,7 +1001,7 @@ def __truediv__(self: array, other: Union[int, float, array], /) -> array:
10011001 ----------
10021002 self: array
10031003 array instance. Should have a numeric data type.
1004- other: Union[int, float, array]
1004+ other: Union[int, float, complex, array]
10051005 other array. Must be compatible with ``self`` (see :ref:`broadcasting`). Should have a numeric data type.
10061006
10071007 Returns
0 commit comments