diff options
author | Guido van Rossum <guido@python.org> | 2002-04-15 01:41:56 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2002-04-15 01:41:56 (GMT) |
commit | 9ec4c78a5414883a9a22453d7930c2d26880570a (patch) | |
tree | c1800c2bcc244e5706137a339885b7711d85a2e0 /Objects/complexobject.c | |
parent | a3a4300fe0d4972b0181a09901a4969034b0ac3a (diff) | |
download | cpython-9ec4c78a5414883a9a22453d7930c2d26880570a.zip cpython-9ec4c78a5414883a9a22453d7930c2d26880570a.tar.gz cpython-9ec4c78a5414883a9a22453d7930c2d26880570a.tar.bz2 |
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.)
Diffstat (limited to 'Objects/complexobject.c')
-rw-r--r-- | Objects/complexobject.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Objects/complexobject.c b/Objects/complexobject.c index c074aee..3c26b5b2 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) { |