Skip to content

Commit ca6cfa1

Browse files
committed
include slots under their reverse names, too
1 parent db007a6 commit ca6cfa1

File tree

1 file changed

+6
-0
lines changed
  • graalpython/com.oracle.graal.python.cext/src

1 file changed

+6
-0
lines changed

graalpython/com.oracle.graal.python.cext/src/object.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -433,8 +433,11 @@ int PyType_Ready(PyTypeObject* cls) {
433433
PyNumberMethods* numbers = cls->tp_as_number;
434434
if (numbers) {
435435
ADD_SLOT("__add__", numbers->nb_add, -2);
436+
ADD_SLOT("__radd__", numbers->nb_add, -2);
436437
ADD_SLOT("__sub__", numbers->nb_subtract, -2);
438+
ADD_SLOT("__rsub__", numbers->nb_subtract, -2);
437439
ADD_SLOT("__mul__", numbers->nb_multiply, -2);
440+
ADD_SLOT("__rmul__", numbers->nb_multiply, -2);
438441
ADD_SLOT("__rem__", numbers->nb_remainder, -2);
439442
ADD_SLOT("__divmod__", numbers->nb_divmod, -2);
440443
ADD_SLOT_CONV("__pow__", wrap_pow, numbers->nb_power, -3);
@@ -446,8 +449,11 @@ int PyType_Ready(PyTypeObject* cls) {
446449
ADD_SLOT("__lshift__", numbers->nb_lshift, -2);
447450
ADD_SLOT("__rshift__", numbers->nb_rshift, -2);
448451
ADD_SLOT("__and__", numbers->nb_and, -2);
452+
ADD_SLOT("__rand__", numbers->nb_and, -2);
449453
ADD_SLOT("__xor__", numbers->nb_xor, -2);
454+
ADD_SLOT("__rxor__", numbers->nb_xor, -2);
450455
ADD_SLOT("__or__", numbers->nb_or, -2);
456+
ADD_SLOT("__ror__", numbers->nb_or, -2);
451457
ADD_SLOT("__int__", numbers->nb_int, -1);
452458
ADD_SLOT("__float__", numbers->nb_float, -1);
453459
ADD_SLOT("__iadd__", numbers->nb_inplace_add, -2);

0 commit comments

Comments
 (0)