@@ -433,8 +433,11 @@ int PyType_Ready(PyTypeObject* cls) {
433
433
PyNumberMethods * numbers = cls -> tp_as_number ;
434
434
if (numbers ) {
435
435
ADD_SLOT ("__add__" , numbers -> nb_add , -2 );
436
+ ADD_SLOT ("__radd__" , numbers -> nb_add , -2 );
436
437
ADD_SLOT ("__sub__" , numbers -> nb_subtract , -2 );
438
+ ADD_SLOT ("__rsub__" , numbers -> nb_subtract , -2 );
437
439
ADD_SLOT ("__mul__" , numbers -> nb_multiply , -2 );
440
+ ADD_SLOT ("__rmul__" , numbers -> nb_multiply , -2 );
438
441
ADD_SLOT ("__rem__" , numbers -> nb_remainder , -2 );
439
442
ADD_SLOT ("__divmod__" , numbers -> nb_divmod , -2 );
440
443
ADD_SLOT_CONV ("__pow__" , wrap_pow , numbers -> nb_power , -3 );
@@ -446,8 +449,11 @@ int PyType_Ready(PyTypeObject* cls) {
446
449
ADD_SLOT ("__lshift__" , numbers -> nb_lshift , -2 );
447
450
ADD_SLOT ("__rshift__" , numbers -> nb_rshift , -2 );
448
451
ADD_SLOT ("__and__" , numbers -> nb_and , -2 );
452
+ ADD_SLOT ("__rand__" , numbers -> nb_and , -2 );
449
453
ADD_SLOT ("__xor__" , numbers -> nb_xor , -2 );
454
+ ADD_SLOT ("__rxor__" , numbers -> nb_xor , -2 );
450
455
ADD_SLOT ("__or__" , numbers -> nb_or , -2 );
456
+ ADD_SLOT ("__ror__" , numbers -> nb_or , -2 );
451
457
ADD_SLOT ("__int__" , numbers -> nb_int , -1 );
452
458
ADD_SLOT ("__float__" , numbers -> nb_float , -1 );
453
459
ADD_SLOT ("__iadd__" , numbers -> nb_inplace_add , -2 );
0 commit comments