diff options
| author | Anthony Baxter <anthonybaxter@gmail.com> | 2002-04-18 05:37:51 (GMT) |
|---|---|---|
| committer | Anthony Baxter <anthonybaxter@gmail.com> | 2002-04-18 05:37:51 (GMT) |
| commit | c82143eb5e5fb44e7b49e763fefe02f71be4f3b4 (patch) | |
| tree | 86602ff27755d1f8be61e6e1e1fe2eaf2401655c /Objects | |
| parent | 93e81e7c1f4daba42716e996e4c1afc587bb4083 (diff) | |
| download | cpython-c82143eb5e5fb44e7b49e763fefe02f71be4f3b4.zip cpython-c82143eb5e5fb44e7b49e763fefe02f71be4f3b4.tar.gz cpython-c82143eb5e5fb44e7b49e763fefe02f71be4f3b4.tar.bz2 | |
backport gvanrossum's patch:
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.)
Original patches were:
python/dist/src/Objects/complexobject.c:2.58
Diffstat (limited to 'Objects')
| -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 8392f5d..5e46546 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) { |
