mirror of
https://github.com/python/cpython.git
synced 2025-11-11 14:44:57 +00:00
str and unicode objects now have a __mod__ slot so don't special case them in
PyNumber_Remainder(). This fixes SF bug #615506 and allows string and unicode subclasses to override __mod__.
This commit is contained in:
parent
47ec6c0790
commit
26db587485
1 changed files with 0 additions and 6 deletions
|
|
@ -639,12 +639,6 @@ PyNumber_TrueDivide(PyObject *v, PyObject *w)
|
||||||
PyObject *
|
PyObject *
|
||||||
PyNumber_Remainder(PyObject *v, PyObject *w)
|
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), "%");
|
return binary_op(v, w, NB_SLOT(nb_remainder), "%");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue