@@ -492,16 +492,17 @@ def {fname}(arg1):
492
492
bcast_actx_ary_types = ()
493
493
494
494
gen (f"""
495
- if { bool (outer_bcast_type_names )} : # optimized away
496
- if isinstance(arg2,
497
- { tup_str (outer_bcast_type_names
498
- + bcast_actx_ary_types )} ):
499
- return cls({ bcast_same_cls_init_args } )
500
495
if { numpy_pred ("arg2" )} :
501
496
result = np.empty_like(arg2, dtype=object)
502
497
for i in np.ndindex(arg2.shape):
503
498
result[i] = { op_str .format ("arg1" , "arg2[i]" )}
504
499
return result
500
+
501
+ if { bool (outer_bcast_type_names )} : # optimized away
502
+ if isinstance(arg2,
503
+ { tup_str (outer_bcast_type_names
504
+ + bcast_actx_ary_types )} ):
505
+ return cls({ bcast_same_cls_init_args } )
505
506
return NotImplemented
506
507
""" )
507
508
gen (f"cls.__{ dunder_name } __ = { fname } " )
@@ -538,16 +539,16 @@ def {fname}(arg1):
538
539
def { fname } (arg2, arg1):
539
540
# assert other.__cls__ is not cls
540
541
541
- if { bool (outer_bcast_type_names )} : # optimized away
542
- if isinstance(arg1,
543
- { tup_str (outer_bcast_type_names
544
- + bcast_actx_ary_types )} ):
545
- return cls({ bcast_init_args } )
546
542
if { numpy_pred ("arg1" )} :
547
543
result = np.empty_like(arg1, dtype=object)
548
544
for i in np.ndindex(arg1.shape):
549
545
result[i] = { op_str .format ("arg1[i]" , "arg2" )}
550
546
return result
547
+ if { bool (outer_bcast_type_names )} : # optimized away
548
+ if isinstance(arg1,
549
+ { tup_str (outer_bcast_type_names
550
+ + bcast_actx_ary_types )} ):
551
+ return cls({ bcast_init_args } )
551
552
return NotImplemented
552
553
553
554
cls.__r{ dunder_name } __ = { fname } """ )
0 commit comments