@@ -656,15 +656,13 @@ def __pos__(self: Array, /) -> Array:
656656 res = self ._array .__pos__ ()
657657 return self .__class__ ._new (res )
658658
659- # PEP 484 requires int to be a subtype of float, but __pow__ should not
660- # accept int.
661- def __pow__ (self : Array , other : Union [float , Array ], / ) -> Array :
659+ def __pow__ (self : Array , other : Union [int , float , Array ], / ) -> Array :
662660 """
663661 Performs the operation __pow__.
664662 """
665663 from ._elementwise_functions import pow
666664
667- other = self ._check_allowed_dtypes (other , "floating-point " , "__pow__" )
665+ other = self ._check_allowed_dtypes (other , "numeric " , "__pow__" )
668666 if other is NotImplemented :
669667 return other
670668 # Note: NumPy's __pow__ does not follow type promotion rules for 0-d
@@ -914,23 +912,23 @@ def __ror__(self: Array, other: Union[int, bool, Array], /) -> Array:
914912 res = self ._array .__ror__ (other ._array )
915913 return self .__class__ ._new (res )
916914
917- def __ipow__ (self : Array , other : Union [float , Array ], / ) -> Array :
915+ def __ipow__ (self : Array , other : Union [int , float , Array ], / ) -> Array :
918916 """
919917 Performs the operation __ipow__.
920918 """
921- other = self ._check_allowed_dtypes (other , "floating-point " , "__ipow__" )
919+ other = self ._check_allowed_dtypes (other , "numeric " , "__ipow__" )
922920 if other is NotImplemented :
923921 return other
924922 self ._array .__ipow__ (other ._array )
925923 return self
926924
927- def __rpow__ (self : Array , other : Union [float , Array ], / ) -> Array :
925+ def __rpow__ (self : Array , other : Union [int , float , Array ], / ) -> Array :
928926 """
929927 Performs the operation __rpow__.
930928 """
931929 from ._elementwise_functions import pow
932930
933- other = self ._check_allowed_dtypes (other , "floating-point " , "__rpow__" )
931+ other = self ._check_allowed_dtypes (other , "numeric " , "__rpow__" )
934932 if other is NotImplemented :
935933 return other
936934 # Note: NumPy's __pow__ does not follow the spec type promotion rules
0 commit comments