@@ -568,10 +568,8 @@ def __iadd__(self: array, other: Union[int, float, array], /) -> array:
568
568
"""
569
569
if isinstance (other , (int , float , bool )):
570
570
other = self ._promote_scalar (other )
571
- res = self ._array .__iadd__ (other ._array )
572
- if res .dtype != self .dtype :
573
- raise RuntimeError
574
- return self .__class__ ._new (res )
571
+ self ._array .__iadd__ (other ._array )
572
+ return self
575
573
576
574
@np .errstate (all = 'ignore' )
577
575
def __radd__ (self : array , other : Union [int , float , array ], / ) -> array :
@@ -590,8 +588,8 @@ def __iand__(self: array, other: Union[int, bool, array], /) -> array:
590
588
"""
591
589
if isinstance (other , (int , float , bool )):
592
590
other = self ._promote_scalar (other )
593
- res = self ._array .__iand__ (other ._array )
594
- return self . __class__ . _new ( res )
591
+ self ._array .__iand__ (other ._array )
592
+ return self
595
593
596
594
def __rand__ (self : array , other : Union [int , bool , array ], / ) -> array :
597
595
"""
@@ -610,8 +608,8 @@ def __ifloordiv__(self: array, other: Union[int, float, array], /) -> array:
610
608
"""
611
609
if isinstance (other , (int , float , bool )):
612
610
other = self ._promote_scalar (other )
613
- res = self ._array .__ifloordiv__ (other ._array )
614
- return self . __class__ . _new ( res )
611
+ self ._array .__ifloordiv__ (other ._array )
612
+ return self
615
613
616
614
@np .errstate (all = 'ignore' )
617
615
def __rfloordiv__ (self : array , other : Union [int , float , array ], / ) -> array :
@@ -630,8 +628,8 @@ def __ilshift__(self: array, other: Union[int, array], /) -> array:
630
628
"""
631
629
if isinstance (other , (int , float , bool )):
632
630
other = self ._promote_scalar (other )
633
- res = self ._array .__ilshift__ (other ._array )
634
- return self . __class__ . _new ( res )
631
+ self ._array .__ilshift__ (other ._array )
632
+ return self
635
633
636
634
def __rlshift__ (self : array , other : Union [int , array ], / ) -> array :
637
635
"""
@@ -675,8 +673,8 @@ def __imod__(self: array, other: Union[int, float, array], /) -> array:
675
673
"""
676
674
if isinstance (other , (int , float , bool )):
677
675
other = self ._promote_scalar (other )
678
- res = self ._array .__imod__ (other ._array )
679
- return self . __class__ . _new ( res )
676
+ self ._array .__imod__ (other ._array )
677
+ return self
680
678
681
679
@np .errstate (all = 'ignore' )
682
680
def __rmod__ (self : array , other : Union [int , float , array ], / ) -> array :
@@ -696,8 +694,8 @@ def __imul__(self: array, other: Union[int, float, array], /) -> array:
696
694
"""
697
695
if isinstance (other , (int , float , bool )):
698
696
other = self ._promote_scalar (other )
699
- res = self ._array .__imul__ (other ._array )
700
- return self . __class__ . _new ( res )
697
+ self ._array .__imul__ (other ._array )
698
+ return self
701
699
702
700
@np .errstate (all = 'ignore' )
703
701
def __rmul__ (self : array , other : Union [int , float , array ], / ) -> array :
@@ -716,8 +714,8 @@ def __ior__(self: array, other: Union[int, bool, array], /) -> array:
716
714
"""
717
715
if isinstance (other , (int , float , bool )):
718
716
other = self ._promote_scalar (other )
719
- res = self ._array .__ior__ (other ._array )
720
- return self . __class__ . _new ( res )
717
+ self ._array .__ior__ (other ._array )
718
+ return self
721
719
722
720
def __ror__ (self : array , other : Union [int , bool , array ], / ) -> array :
723
721
"""
@@ -736,8 +734,8 @@ def __ipow__(self: array, other: Union[int, float, array], /) -> array:
736
734
"""
737
735
if isinstance (other , (int , float , bool )):
738
736
other = self ._promote_scalar (other )
739
- res = self ._array .__ipow__ (other ._array )
740
- return self . __class__ . _new ( res )
737
+ self ._array .__ipow__ (other ._array )
738
+ return self
741
739
742
740
@np .errstate (all = 'ignore' )
743
741
def __rpow__ (self : array , other : Union [int , float , array ], / ) -> array :
@@ -758,8 +756,8 @@ def __irshift__(self: array, other: Union[int, array], /) -> array:
758
756
"""
759
757
if isinstance (other , (int , float , bool )):
760
758
other = self ._promote_scalar (other )
761
- res = self ._array .__irshift__ (other ._array )
762
- return self . __class__ . _new ( res )
759
+ self ._array .__irshift__ (other ._array )
760
+ return self
763
761
764
762
def __rrshift__ (self : array , other : Union [int , array ], / ) -> array :
765
763
"""
@@ -781,8 +779,8 @@ def __isub__(self: array, other: Union[int, float, array], /) -> array:
781
779
"""
782
780
if isinstance (other , (int , float , bool )):
783
781
other = self ._promote_scalar (other )
784
- res = self ._array .__isub__ (other ._array )
785
- return self . __class__ . _new ( res )
782
+ self ._array .__isub__ (other ._array )
783
+ return self
786
784
787
785
@np .errstate (all = 'ignore' )
788
786
def __rsub__ (self : array , other : Union [int , float , array ], / ) -> array :
@@ -802,8 +800,8 @@ def __itruediv__(self: array, other: Union[int, float, array], /) -> array:
802
800
"""
803
801
if isinstance (other , (int , float , bool )):
804
802
other = self ._promote_scalar (other )
805
- res = self ._array .__itruediv__ (other ._array )
806
- return self . __class__ . _new ( res )
803
+ self ._array .__itruediv__ (other ._array )
804
+ return self
807
805
808
806
@np .errstate (all = 'ignore' )
809
807
def __rtruediv__ (self : array , other : Union [int , float , array ], / ) -> array :
@@ -822,8 +820,8 @@ def __ixor__(self: array, other: Union[int, bool, array], /) -> array:
822
820
"""
823
821
if isinstance (other , (int , float , bool )):
824
822
other = self ._promote_scalar (other )
825
- res = self ._array .__ixor__ (other ._array )
826
- return self . __class__ . _new ( res )
823
+ self ._array .__ixor__ (other ._array )
824
+ return self
827
825
828
826
def __rxor__ (self : array , other : Union [int , bool , array ], / ) -> array :
829
827
"""
0 commit comments