@@ -1176,48 +1176,48 @@ def _create_arithmetic_method(cls, op):
1176
1176
1177
1177
@classmethod
1178
1178
def _add_arithmetic_ops (cls ):
1179
- cls . __add__ = cls ._create_arithmetic_method (operator .add )
1180
- cls . __radd__ = cls ._create_arithmetic_method (ops .radd )
1181
- cls . __sub__ = cls ._create_arithmetic_method (operator .sub )
1182
- cls . __rsub__ = cls ._create_arithmetic_method (ops .rsub )
1183
- cls . __mul__ = cls ._create_arithmetic_method (operator .mul )
1184
- cls . __rmul__ = cls ._create_arithmetic_method (ops .rmul )
1185
- cls . __pow__ = cls ._create_arithmetic_method (operator .pow )
1186
- cls . __rpow__ = cls ._create_arithmetic_method (ops .rpow )
1187
- cls . __mod__ = cls ._create_arithmetic_method (operator .mod )
1188
- cls . __rmod__ = cls ._create_arithmetic_method (ops .rmod )
1189
- cls . __floordiv__ = cls ._create_arithmetic_method (operator .floordiv )
1190
- cls . __rfloordiv__ = cls ._create_arithmetic_method (ops .rfloordiv )
1191
- cls . __truediv__ = cls ._create_arithmetic_method (operator .truediv )
1192
- cls . __rtruediv__ = cls ._create_arithmetic_method (ops .rtruediv )
1193
- cls . __divmod__ = cls ._create_arithmetic_method (divmod )
1194
- cls . __rdivmod__ = cls ._create_arithmetic_method (ops .rdivmod )
1179
+ setattr ( cls , " __add__" , cls ._create_arithmetic_method (operator .add ) )
1180
+ setattr ( cls , " __radd__" , cls ._create_arithmetic_method (ops .radd ) )
1181
+ setattr ( cls , " __sub__" , cls ._create_arithmetic_method (operator .sub ) )
1182
+ setattr ( cls , " __rsub__" , cls ._create_arithmetic_method (ops .rsub ) )
1183
+ setattr ( cls , " __mul__" , cls ._create_arithmetic_method (operator .mul ) )
1184
+ setattr ( cls , " __rmul__" , cls ._create_arithmetic_method (ops .rmul ) )
1185
+ setattr ( cls , " __pow__" , cls ._create_arithmetic_method (operator .pow ) )
1186
+ setattr ( cls , " __rpow__" , cls ._create_arithmetic_method (ops .rpow ) )
1187
+ setattr ( cls , " __mod__" , cls ._create_arithmetic_method (operator .mod ) )
1188
+ setattr ( cls , " __rmod__" , cls ._create_arithmetic_method (ops .rmod ) )
1189
+ setattr ( cls , " __floordiv__" , cls ._create_arithmetic_method (operator .floordiv ) )
1190
+ setattr ( cls , " __rfloordiv__" , cls ._create_arithmetic_method (ops .rfloordiv ) )
1191
+ setattr ( cls , " __truediv__" , cls ._create_arithmetic_method (operator .truediv ) )
1192
+ setattr ( cls , " __rtruediv__" , cls ._create_arithmetic_method (ops .rtruediv ) )
1193
+ setattr ( cls , " __divmod__" , cls ._create_arithmetic_method (divmod ) )
1194
+ setattr ( cls , " __rdivmod__" , cls ._create_arithmetic_method (ops .rdivmod ) )
1195
1195
1196
1196
@classmethod
1197
1197
def _create_comparison_method (cls , op ):
1198
1198
raise AbstractMethodError (cls )
1199
1199
1200
1200
@classmethod
1201
1201
def _add_comparison_ops (cls ):
1202
- cls . __eq__ = cls ._create_comparison_method (operator .eq )
1203
- cls . __ne__ = cls ._create_comparison_method (operator .ne )
1204
- cls . __lt__ = cls ._create_comparison_method (operator .lt )
1205
- cls . __gt__ = cls ._create_comparison_method (operator .gt )
1206
- cls . __le__ = cls ._create_comparison_method (operator .le )
1207
- cls . __ge__ = cls ._create_comparison_method (operator .ge )
1202
+ setattr ( cls , " __eq__" , cls ._create_comparison_method (operator .eq ) )
1203
+ setattr ( cls , " __ne__" , cls ._create_comparison_method (operator .ne ) )
1204
+ setattr ( cls , " __lt__" , cls ._create_comparison_method (operator .lt ) )
1205
+ setattr ( cls , " __gt__" , cls ._create_comparison_method (operator .gt ) )
1206
+ setattr ( cls , " __le__" , cls ._create_comparison_method (operator .le ) )
1207
+ setattr ( cls , " __ge__" , cls ._create_comparison_method (operator .ge ) )
1208
1208
1209
1209
@classmethod
1210
1210
def _create_logical_method (cls , op ):
1211
1211
raise AbstractMethodError (cls )
1212
1212
1213
1213
@classmethod
1214
1214
def _add_logical_ops (cls ):
1215
- cls . __and__ = cls ._create_logical_method (operator .and_ )
1216
- cls . __rand__ = cls ._create_logical_method (ops .rand_ )
1217
- cls . __or__ = cls ._create_logical_method (operator .or_ )
1218
- cls . __ror__ = cls ._create_logical_method (ops .ror_ )
1219
- cls . __xor__ = cls ._create_logical_method (operator .xor )
1220
- cls . __rxor__ = cls ._create_logical_method (ops .rxor )
1215
+ setattr ( cls , " __and__" , cls ._create_logical_method (operator .and_ ) )
1216
+ setattr ( cls , " __rand__" , cls ._create_logical_method (ops .rand_ ) )
1217
+ setattr ( cls , " __or__" , cls ._create_logical_method (operator .or_ ) )
1218
+ setattr ( cls , " __ror__" , cls ._create_logical_method (ops .ror_ ) )
1219
+ setattr ( cls , " __xor__" , cls ._create_logical_method (operator .xor ) )
1220
+ setattr ( cls , " __rxor__" , cls ._create_logical_method (ops .rxor ) )
1221
1221
1222
1222
1223
1223
class ExtensionScalarOpsMixin (ExtensionOpsMixin ):
0 commit comments