From: Guido van Rossum Date: Mon, 15 Apr 2002 01:41:56 +0000 (+0000) Subject: SF bug #543387. X-Git-Tag: v2.3c1~5964 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9ec4c78a5414883a9a22453d7930c2d26880570a;p=thirdparty%2FPython%2Fcpython.git SF bug #543387. Complex numbers implement divmod() and //, neither of which makes one lick of sense. Unfortunately this is documented, so I'm adding a deprecation warning now, so we can delete this silliness, oh, around 2005 or so. Bugfix candidate (At least for 2.2.2, I think.) --- diff --git a/Objects/complexobject.c b/Objects/complexobject.c index c074aee7fb9f..3c26b5b243bb 100644 --- a/Objects/complexobject.c +++ b/Objects/complexobject.c @@ -418,6 +418,11 @@ complex_divmod(PyComplexObject *v, PyComplexObject *w) { Py_complex div, mod; PyObject *d, *m, *z; + + if (PyErr_Warn(PyExc_DeprecationWarning, + "complex divmod() and // are deprecated") < 0) + return NULL; + errno = 0; div = c_quot(v->cval,w->cval); /* The raw divisor value. */ if (errno == EDOM) {