Mercurial > cpython-lru_cache-weakref
diff Objects/complexobject.c @ 23148:c4609ca17e3e 2.2
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
| author | Anthony Baxter <anthonybaxter@gmail.com> |
|---|---|
| date | Thu, 18 Apr 2002 05:37:51 +0000 |
| parents | 0ba23341e5cf |
| children | 52257affe0c9 |
line wrap: on
line diff
--- a/Objects/complexobject.c Thu Apr 18 05:22:33 2002 +0000 +++ b/Objects/complexobject.c Thu Apr 18 05:37:51 2002 +0000 @@ -418,6 +418,11 @@ { 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) {
