From b09a3d69a614c767653a12428d1ac816f516f36e Mon Sep 17 00:00:00 2001 From: Mark Dickinson Date: Thu, 23 Sep 2010 20:11:19 +0000 Subject: 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. --- Objects/typeobject.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'Objects/typeobject.c') diff --git a/Objects/typeobject.c b/Objects/typeobject.c index 897374d487..7bdcb1233c 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -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); } -- cgit v1.2.1