Issue #9930: Remove an unnecessary type check in wrap_binaryfunc_r;

this was causing reversed method calls like float.__radd__(3.0, 1) to
return NotImplemented instead of the expected numeric value.
This commit is contained in:
Mark Dickinson 2010-09-23 20:11:19 +00:00
parent e8e4b3bfd6
commit b09a3d69a6
3 changed files with 9 additions and 4 deletions

View file

@ -4063,10 +4063,6 @@ wrap_binaryfunc_r(PyObject *self, PyObject *args, void *wrapped)
if (!check_num_args(args, 1))
return NULL;
other = PyTuple_GET_ITEM(args, 0);
if (!PyType_IsSubtype(Py_TYPE(other), Py_TYPE(self))) {
Py_INCREF(Py_NotImplemented);
return Py_NotImplemented;
}
return (*func)(other, self);
}