]> granicus.if.org Git - python/commitdiff
SF bug #543387.
authorGuido van Rossum <guido@python.org>
Mon, 15 Apr 2002 01:41:56 +0000 (01:41 +0000)
committerGuido van Rossum <guido@python.org>
Mon, 15 Apr 2002 01:41:56 +0000 (01:41 +0000)
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.)

Objects/complexobject.c

index c074aee7fb9fb37513b179d56c26f38a9d54d1e2..3c26b5b243bb2de5afd144c603530aa708e62172 100644 (file)
@@ -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) {