@@ -529,7 +529,11 @@ def _create_methods(cls, arith_method, comp_method, bool_method,
529
529
# divmod doesn't have an op that is supported by numexpr
530
530
new_methods ['divmod' ] = arith_method (cls , divmod , special )
531
531
532
- new_methods = {v .__name__ : v for k , v in new_methods .items ()}
532
+ if special :
533
+ dunderize = lambda x : '__{name}__' .format (name = x .strip ('_' ))
534
+ else :
535
+ dunderize = lambda x : x
536
+ new_methods = {dunderize (k ): v for k , v in new_methods .items ()}
533
537
return new_methods
534
538
535
539
@@ -565,7 +569,6 @@ def add_special_arithmetic_methods(cls, arith_method=None,
565
569
"""
566
570
new_methods = _create_methods (cls , arith_method , comp_method , bool_method ,
567
571
special = True )
568
-
569
572
# inplace operators (I feel like these should get passed an `inplace=True`
570
573
# or just be removed
571
574
@@ -1368,7 +1371,7 @@ def f(self, other, axis=0):
1368
1371
comp_method = _comp_method_PANEL ,
1369
1372
bool_method = _arith_method_PANEL )
1370
1373
1371
- panel_flex_funcs = dict (arith_method = _flex_method_PANEL ,
1374
+ panel_flex_funcs = dict (flex_arith_method = _flex_method_PANEL ,
1372
1375
flex_comp_method = _comp_method_PANEL )
1373
1376
1374
1377
# -----------------------------------------------------------------------------
0 commit comments