]> granicus.if.org Git - python/commitdiff
str and unicode objects now have a __mod__ slot so don't special case them in
authorNeil Schemenauer <nascheme@enme.ucalgary.ca>
Mon, 18 Nov 2002 16:04:52 +0000 (16:04 +0000)
committerNeil Schemenauer <nascheme@enme.ucalgary.ca>
Mon, 18 Nov 2002 16:04:52 +0000 (16:04 +0000)
PyNumber_Remainder().  This fixes SF bug #615506 and allows string and unicode
subclasses to override __mod__.

Objects/abstract.c

index 4f8dd3e533e49549e05d310490ab5feb3e401f96..2df934db8afdc9fc687fc96575169ee6fcb9ce57 100644 (file)
@@ -639,12 +639,6 @@ PyNumber_TrueDivide(PyObject *v, PyObject *w)
 PyObject *
 PyNumber_Remainder(PyObject *v, PyObject *w)
 {
-       if (PyString_Check(v))
-               return PyString_Format(v, w);
-#ifdef Py_USING_UNICODE
-       else if (PyUnicode_Check(v))
-               return PyUnicode_Format(v, w);
-#endif
        return binary_op(v, w, NB_SLOT(nb_remainder), "%");
 }