@@ -150,7 +150,7 @@ def __abs__(self: array, /) -> array:
150
150
return self .__class__ ._new (res )
151
151
152
152
@np .errstate (all = 'ignore' )
153
- def __add__ (self : array , other : array , / ) -> array :
153
+ def __add__ (self : array , other : Union [ int , float , array ] , / ) -> array :
154
154
"""
155
155
Performs the operation __add__.
156
156
"""
@@ -160,7 +160,7 @@ def __add__(self: array, other: array, /) -> array:
160
160
res = self ._array .__add__ (other ._array )
161
161
return self .__class__ ._new (res )
162
162
163
- def __and__ (self : array , other : array , / ) -> array :
163
+ def __and__ (self : array , other : Union [ int , bool , array ] , / ) -> array :
164
164
"""
165
165
Performs the operation __and__.
166
166
"""
@@ -201,7 +201,7 @@ def __dlpack_device__(self: array, /) -> Tuple[IntEnum, int]:
201
201
res = self ._array .__dlpack_device__ ()
202
202
return self .__class__ ._new (res )
203
203
204
- def __eq__ (self : array , other : array , / ) -> array :
204
+ def __eq__ (self : array , other : Union [ int , float , bool , array ] , / ) -> array :
205
205
"""
206
206
Performs the operation __eq__.
207
207
"""
@@ -222,7 +222,7 @@ def __float__(self: array, /) -> float:
222
222
return res
223
223
224
224
@np .errstate (all = 'ignore' )
225
- def __floordiv__ (self : array , other : array , / ) -> array :
225
+ def __floordiv__ (self : array , other : Union [ int , float , array ] , / ) -> array :
226
226
"""
227
227
Performs the operation __floordiv__.
228
228
"""
@@ -232,7 +232,7 @@ def __floordiv__(self: array, other: array, /) -> array:
232
232
res = self ._array .__floordiv__ (other ._array )
233
233
return self .__class__ ._new (res )
234
234
235
- def __ge__ (self : array , other : array , / ) -> array :
235
+ def __ge__ (self : array , other : Union [ int , float , array ] , / ) -> array :
236
236
"""
237
237
Performs the operation __ge__.
238
238
"""
@@ -359,7 +359,7 @@ def __getitem__(self: array, key: Union[int, slice, ellipsis, Tuple[Union[int, s
359
359
res = self ._array .__getitem__ (key )
360
360
return self .__class__ ._new (res )
361
361
362
- def __gt__ (self : array , other : array , / ) -> array :
362
+ def __gt__ (self : array , other : Union [ int , float , array ] , / ) -> array :
363
363
"""
364
364
Performs the operation __gt__.
365
365
"""
@@ -386,7 +386,7 @@ def __invert__(self: array, /) -> array:
386
386
res = self ._array .__invert__ ()
387
387
return self .__class__ ._new (res )
388
388
389
- def __le__ (self : array , other : array , / ) -> array :
389
+ def __le__ (self : array , other : Union [ int , float , array ] , / ) -> array :
390
390
"""
391
391
Performs the operation __le__.
392
392
"""
@@ -403,7 +403,7 @@ def __len__(self, /):
403
403
res = self ._array .__len__ ()
404
404
return self .__class__ ._new (res )
405
405
406
- def __lshift__ (self : array , other : array , / ) -> array :
406
+ def __lshift__ (self : array , other : Union [ int , array ] , / ) -> array :
407
407
"""
408
408
Performs the operation __lshift__.
409
409
"""
@@ -416,7 +416,7 @@ def __lshift__(self: array, other: array, /) -> array:
416
416
res = self ._array .__lshift__ (other ._array ).astype (self .dtype )
417
417
return self .__class__ ._new (res )
418
418
419
- def __lt__ (self : array , other : array , / ) -> array :
419
+ def __lt__ (self : array , other : Union [ int , float , array ] , / ) -> array :
420
420
"""
421
421
Performs the operation __lt__.
422
422
"""
@@ -438,7 +438,7 @@ def __matmul__(self: array, other: array, /) -> array:
438
438
return self .__class__ ._new (res )
439
439
440
440
@np .errstate (all = 'ignore' )
441
- def __mod__ (self : array , other : array , / ) -> array :
441
+ def __mod__ (self : array , other : Union [ int , float , array ] , / ) -> array :
442
442
"""
443
443
Performs the operation __mod__.
444
444
"""
@@ -449,7 +449,7 @@ def __mod__(self: array, other: array, /) -> array:
449
449
return self .__class__ ._new (res )
450
450
451
451
@np .errstate (all = 'ignore' )
452
- def __mul__ (self : array , other : array , / ) -> array :
452
+ def __mul__ (self : array , other : Union [ int , float , array ] , / ) -> array :
453
453
"""
454
454
Performs the operation __mul__.
455
455
"""
@@ -459,7 +459,7 @@ def __mul__(self: array, other: array, /) -> array:
459
459
res = self ._array .__mul__ (other ._array )
460
460
return self .__class__ ._new (res )
461
461
462
- def __ne__ (self : array , other : array , / ) -> array :
462
+ def __ne__ (self : array , other : Union [ int , float , bool , array ] , / ) -> array :
463
463
"""
464
464
Performs the operation __ne__.
465
465
"""
@@ -476,7 +476,7 @@ def __neg__(self: array, /) -> array:
476
476
res = self ._array .__neg__ ()
477
477
return self .__class__ ._new (res )
478
478
479
- def __or__ (self : array , other : array , / ) -> array :
479
+ def __or__ (self : array , other : Union [ int , bool , array ] , / ) -> array :
480
480
"""
481
481
Performs the operation __or__.
482
482
"""
@@ -494,7 +494,7 @@ def __pos__(self: array, /) -> array:
494
494
return self .__class__ ._new (res )
495
495
496
496
@np .errstate (all = 'ignore' )
497
- def __pow__ (self : array , other : array , / ) -> array :
497
+ def __pow__ (self : array , other : Union [ int , float , array ] , / ) -> array :
498
498
"""
499
499
Performs the operation __pow__.
500
500
"""
@@ -506,7 +506,7 @@ def __pow__(self: array, other: array, /) -> array:
506
506
# arrays, so we use pow() here instead.
507
507
return pow (self , other )
508
508
509
- def __rshift__ (self : array , other : array , / ) -> array :
509
+ def __rshift__ (self : array , other : Union [ int , array ] , / ) -> array :
510
510
"""
511
511
Performs the operation __rshift__.
512
512
"""
@@ -530,7 +530,7 @@ def __setitem__(self, key, value, /):
530
530
return self .__class__ ._new (res )
531
531
532
532
@np .errstate (all = 'ignore' )
533
- def __sub__ (self : array , other : array , / ) -> array :
533
+ def __sub__ (self : array , other : Union [ int , float , array ] , / ) -> array :
534
534
"""
535
535
Performs the operation __sub__.
536
536
"""
@@ -541,7 +541,7 @@ def __sub__(self: array, other: array, /) -> array:
541
541
return self .__class__ ._new (res )
542
542
543
543
@np .errstate (all = 'ignore' )
544
- def __truediv__ (self : array , other : array , / ) -> array :
544
+ def __truediv__ (self : array , other : Union [ int , float , array ] , / ) -> array :
545
545
"""
546
546
Performs the operation __truediv__.
547
547
"""
@@ -551,7 +551,7 @@ def __truediv__(self: array, other: array, /) -> array:
551
551
res = self ._array .__truediv__ (other ._array )
552
552
return self .__class__ ._new (res )
553
553
554
- def __xor__ (self : array , other : array , / ) -> array :
554
+ def __xor__ (self : array , other : Union [ int , bool , array ] , / ) -> array :
555
555
"""
556
556
Performs the operation __xor__.
557
557
"""
@@ -562,7 +562,7 @@ def __xor__(self: array, other: array, /) -> array:
562
562
return self .__class__ ._new (res )
563
563
564
564
@np .errstate (all = 'ignore' )
565
- def __iadd__ (self : array , other : array , / ) -> array :
565
+ def __iadd__ (self : array , other : Union [ int , float , array ] , / ) -> array :
566
566
"""
567
567
Performs the operation __iadd__.
568
568
"""
@@ -574,7 +574,7 @@ def __iadd__(self: array, other: array, /) -> array:
574
574
return self .__class__ ._new (res )
575
575
576
576
@np .errstate (all = 'ignore' )
577
- def __radd__ (self : array , other : array , / ) -> array :
577
+ def __radd__ (self : array , other : Union [ int , float , array ] , / ) -> array :
578
578
"""
579
579
Performs the operation __radd__.
580
580
"""
@@ -584,7 +584,7 @@ def __radd__(self: array, other: array, /) -> array:
584
584
res = self ._array .__radd__ (other ._array )
585
585
return self .__class__ ._new (res )
586
586
587
- def __iand__ (self : array , other : array , / ) -> array :
587
+ def __iand__ (self : array , other : Union [ int , bool , array ] , / ) -> array :
588
588
"""
589
589
Performs the operation __iand__.
590
590
"""
@@ -593,7 +593,7 @@ def __iand__(self: array, other: array, /) -> array:
593
593
res = self ._array .__iand__ (other ._array )
594
594
return self .__class__ ._new (res )
595
595
596
- def __rand__ (self : array , other : array , / ) -> array :
596
+ def __rand__ (self : array , other : Union [ int , bool , array ] , / ) -> array :
597
597
"""
598
598
Performs the operation __rand__.
599
599
"""
@@ -604,7 +604,7 @@ def __rand__(self: array, other: array, /) -> array:
604
604
return self .__class__ ._new (res )
605
605
606
606
@np .errstate (all = 'ignore' )
607
- def __ifloordiv__ (self : array , other : array , / ) -> array :
607
+ def __ifloordiv__ (self : array , other : Union [ int , float , array ] , / ) -> array :
608
608
"""
609
609
Performs the operation __ifloordiv__.
610
610
"""
@@ -614,7 +614,7 @@ def __ifloordiv__(self: array, other: array, /) -> array:
614
614
return self .__class__ ._new (res )
615
615
616
616
@np .errstate (all = 'ignore' )
617
- def __rfloordiv__ (self : array , other : array , / ) -> array :
617
+ def __rfloordiv__ (self : array , other : Union [ int , float , array ] , / ) -> array :
618
618
"""
619
619
Performs the operation __rfloordiv__.
620
620
"""
@@ -624,7 +624,7 @@ def __rfloordiv__(self: array, other: array, /) -> array:
624
624
res = self ._array .__rfloordiv__ (other ._array )
625
625
return self .__class__ ._new (res )
626
626
627
- def __ilshift__ (self : array , other : array , / ) -> array :
627
+ def __ilshift__ (self : array , other : Union [ int , array ] , / ) -> array :
628
628
"""
629
629
Performs the operation __ilshift__.
630
630
"""
@@ -633,7 +633,7 @@ def __ilshift__(self: array, other: array, /) -> array:
633
633
res = self ._array .__ilshift__ (other ._array )
634
634
return self .__class__ ._new (res )
635
635
636
- def __rlshift__ (self : array , other : array , / ) -> array :
636
+ def __rlshift__ (self : array , other : Union [ int , array ] , / ) -> array :
637
637
"""
638
638
Performs the operation __rlshift__.
639
639
"""
@@ -669,7 +669,7 @@ def __rmatmul__(self: array, other: array, /) -> array:
669
669
return self .__class__ ._new (res )
670
670
671
671
@np .errstate (all = 'ignore' )
672
- def __imod__ (self : array , other : array , / ) -> array :
672
+ def __imod__ (self : array , other : Union [ int , float , array ] , / ) -> array :
673
673
"""
674
674
Performs the operation __imod__.
675
675
"""
@@ -679,7 +679,7 @@ def __imod__(self: array, other: array, /) -> array:
679
679
return self .__class__ ._new (res )
680
680
681
681
@np .errstate (all = 'ignore' )
682
- def __rmod__ (self : array , other : array , / ) -> array :
682
+ def __rmod__ (self : array , other : Union [ int , float , array ] , / ) -> array :
683
683
"""
684
684
Performs the operation __rmod__.
685
685
"""
@@ -690,7 +690,7 @@ def __rmod__(self: array, other: array, /) -> array:
690
690
return self .__class__ ._new (res )
691
691
692
692
@np .errstate (all = 'ignore' )
693
- def __imul__ (self : array , other : array , / ) -> array :
693
+ def __imul__ (self : array , other : Union [ int , float , array ] , / ) -> array :
694
694
"""
695
695
Performs the operation __imul__.
696
696
"""
@@ -700,7 +700,7 @@ def __imul__(self: array, other: array, /) -> array:
700
700
return self .__class__ ._new (res )
701
701
702
702
@np .errstate (all = 'ignore' )
703
- def __rmul__ (self : array , other : array , / ) -> array :
703
+ def __rmul__ (self : array , other : Union [ int , float , array ] , / ) -> array :
704
704
"""
705
705
Performs the operation __rmul__.
706
706
"""
@@ -710,7 +710,7 @@ def __rmul__(self: array, other: array, /) -> array:
710
710
res = self ._array .__rmul__ (other ._array )
711
711
return self .__class__ ._new (res )
712
712
713
- def __ior__ (self : array , other : array , / ) -> array :
713
+ def __ior__ (self : array , other : Union [ int , bool , array ] , / ) -> array :
714
714
"""
715
715
Performs the operation __ior__.
716
716
"""
@@ -719,7 +719,7 @@ def __ior__(self: array, other: array, /) -> array:
719
719
res = self ._array .__ior__ (other ._array )
720
720
return self .__class__ ._new (res )
721
721
722
- def __ror__ (self : array , other : array , / ) -> array :
722
+ def __ror__ (self : array , other : Union [ int , bool , array ] , / ) -> array :
723
723
"""
724
724
Performs the operation __ror__.
725
725
"""
@@ -730,7 +730,7 @@ def __ror__(self: array, other: array, /) -> array:
730
730
return self .__class__ ._new (res )
731
731
732
732
@np .errstate (all = 'ignore' )
733
- def __ipow__ (self : array , other : array , / ) -> array :
733
+ def __ipow__ (self : array , other : Union [ int , float , array ] , / ) -> array :
734
734
"""
735
735
Performs the operation __ipow__.
736
736
"""
@@ -740,7 +740,7 @@ def __ipow__(self: array, other: array, /) -> array:
740
740
return self .__class__ ._new (res )
741
741
742
742
@np .errstate (all = 'ignore' )
743
- def __rpow__ (self : array , other : array , / ) -> array :
743
+ def __rpow__ (self : array , other : Union [ int , float , array ] , / ) -> array :
744
744
"""
745
745
Performs the operation __rpow__.
746
746
"""
@@ -752,7 +752,7 @@ def __rpow__(self: array, other: array, /) -> array:
752
752
# for 0-d arrays, so we use pow() here instead.
753
753
return pow (other , self )
754
754
755
- def __irshift__ (self : array , other : array , / ) -> array :
755
+ def __irshift__ (self : array , other : Union [ int , array ] , / ) -> array :
756
756
"""
757
757
Performs the operation __irshift__.
758
758
"""
@@ -761,7 +761,7 @@ def __irshift__(self: array, other: array, /) -> array:
761
761
res = self ._array .__irshift__ (other ._array )
762
762
return self .__class__ ._new (res )
763
763
764
- def __rrshift__ (self : array , other : array , / ) -> array :
764
+ def __rrshift__ (self : array , other : Union [ int , array ] , / ) -> array :
765
765
"""
766
766
Performs the operation __rrshift__.
767
767
"""
@@ -775,7 +775,7 @@ def __rrshift__(self: array, other: array, /) -> array:
775
775
return self .__class__ ._new (res )
776
776
777
777
@np .errstate (all = 'ignore' )
778
- def __isub__ (self : array , other : array , / ) -> array :
778
+ def __isub__ (self : array , other : Union [ int , float , array ] , / ) -> array :
779
779
"""
780
780
Performs the operation __isub__.
781
781
"""
@@ -785,7 +785,7 @@ def __isub__(self: array, other: array, /) -> array:
785
785
return self .__class__ ._new (res )
786
786
787
787
@np .errstate (all = 'ignore' )
788
- def __rsub__ (self : array , other : array , / ) -> array :
788
+ def __rsub__ (self : array , other : Union [ int , float , array ] , / ) -> array :
789
789
"""
790
790
Performs the operation __rsub__.
791
791
"""
@@ -796,7 +796,7 @@ def __rsub__(self: array, other: array, /) -> array:
796
796
return self .__class__ ._new (res )
797
797
798
798
@np .errstate (all = 'ignore' )
799
- def __itruediv__ (self : array , other : array , / ) -> array :
799
+ def __itruediv__ (self : array , other : Union [ int , float , array ] , / ) -> array :
800
800
"""
801
801
Performs the operation __itruediv__.
802
802
"""
@@ -806,7 +806,7 @@ def __itruediv__(self: array, other: array, /) -> array:
806
806
return self .__class__ ._new (res )
807
807
808
808
@np .errstate (all = 'ignore' )
809
- def __rtruediv__ (self : array , other : array , / ) -> array :
809
+ def __rtruediv__ (self : array , other : Union [ int , float , array ] , / ) -> array :
810
810
"""
811
811
Performs the operation __rtruediv__.
812
812
"""
@@ -816,7 +816,7 @@ def __rtruediv__(self: array, other: array, /) -> array:
816
816
res = self ._array .__rtruediv__ (other ._array )
817
817
return self .__class__ ._new (res )
818
818
819
- def __ixor__ (self : array , other : array , / ) -> array :
819
+ def __ixor__ (self : array , other : Union [ int , bool , array ] , / ) -> array :
820
820
"""
821
821
Performs the operation __ixor__.
822
822
"""
@@ -825,7 +825,7 @@ def __ixor__(self: array, other: array, /) -> array:
825
825
res = self ._array .__ixor__ (other ._array )
826
826
return self .__class__ ._new (res )
827
827
828
- def __rxor__ (self : array , other : array , / ) -> array :
828
+ def __rxor__ (self : array , other : Union [ int , bool , array ] , / ) -> array :
829
829
"""
830
830
Performs the operation __rxor__.
831
831
"""
0 commit comments