@@ -186,8 +186,10 @@ def add_special_arithmetic_methods(cls, arith_method=None,
186
186
arith_method : function (optional)
187
187
factory for special arithmetic methods, with op string:
188
188
f(op, name, str_rep, default_axis=None, fill_zeros=None, **eval_kwargs)
189
- comp_method : function, optional,
189
+ comp_method : function ( optional)
190
190
factory for rich comparison - signature: f(op, name, str_rep)
191
+ bool_method : function (optional)
192
+ factory for boolean methods - signature: f(op, name, str_rep)
191
193
use_numexpr : bool, default True
192
194
whether to accelerate with numexpr, defaults to True
193
195
force : bool, default False
@@ -234,9 +236,16 @@ def f(self, other):
234
236
__isub__ = _wrap_inplace_method (new_methods ["__sub__" ]),
235
237
__imul__ = _wrap_inplace_method (new_methods ["__mul__" ]),
236
238
__itruediv__ = _wrap_inplace_method (new_methods ["__truediv__" ]),
237
- __ipow__ = _wrap_inplace_method (new_methods ["__pow__" ]), ))
239
+ __ifloordiv__ = _wrap_inplace_method (new_methods ["__floordiv__" ]),
240
+ __imod__ = _wrap_inplace_method (new_methods ["__mod__" ]),
241
+ __ipow__ = _wrap_inplace_method (new_methods ["__pow__" ])))
238
242
if not compat .PY3 :
239
- new_methods ["__idiv__" ] = new_methods ["__div__" ]
243
+ new_methods ["__idiv__" ] = _wrap_inplace_method (new_methods ["__div__" ])
244
+ if bool_method :
245
+ new_methods .update (
246
+ dict (__iand__ = _wrap_inplace_method (new_methods ["__and__" ]),
247
+ __ior__ = _wrap_inplace_method (new_methods ["__or__" ]),
248
+ __ixor__ = _wrap_inplace_method (new_methods ["__xor__" ])))
240
249
241
250
add_methods (cls , new_methods = new_methods , force = force , select = select ,
242
251
exclude = exclude )
0 commit comments