Kaydet (Commit) 69cf3c76 authored tarafından Guido van Rossum's avatar Guido van Rossum

Deprecate % as well. The message for deprecation of //, % and divmod

is the same in all three cases (mostly because // calls divmod :-).
üst 862fe3c5
...@@ -399,6 +399,11 @@ static PyObject * ...@@ -399,6 +399,11 @@ static PyObject *
complex_remainder(PyComplexObject *v, PyComplexObject *w) complex_remainder(PyComplexObject *v, PyComplexObject *w)
{ {
Py_complex div, mod; Py_complex div, mod;
if (PyErr_Warn(PyExc_DeprecationWarning,
"complex divmod(), // and % are deprecated") < 0)
return NULL;
errno = 0; errno = 0;
div = c_quot(v->cval,w->cval); /* The raw divisor value. */ div = c_quot(v->cval,w->cval); /* The raw divisor value. */
if (errno == EDOM) { if (errno == EDOM) {
...@@ -420,7 +425,7 @@ complex_divmod(PyComplexObject *v, PyComplexObject *w) ...@@ -420,7 +425,7 @@ complex_divmod(PyComplexObject *v, PyComplexObject *w)
PyObject *d, *m, *z; PyObject *d, *m, *z;
if (PyErr_Warn(PyExc_DeprecationWarning, if (PyErr_Warn(PyExc_DeprecationWarning,
"complex divmod() and // are deprecated") < 0) "complex divmod(), // and % are deprecated") < 0)
return NULL; return NULL;
errno = 0; errno = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment