[Python-checkins] python/dist/src/Objects complexobject.c,2.53.4.3,2.53.4.4
anthonybaxter@sourceforge.net
anthonybaxter@sourceforge.net
Wed, 17 Apr 2002 22:37:53 -0700
Update of /cvsroot/python/python/dist/src/Objects
In directory usw-pr-cvs1:/tmp/cvs-serv17786/Objects
Modified Files:
Tag: release22-maint
complexobject.c
Log Message:
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
Index: complexobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/complexobject.c,v
retrieving revision 2.53.4.3
retrieving revision 2.53.4.4
diff -C2 -d -r2.53.4.3 -r2.53.4.4
*** complexobject.c 18 Apr 2002 02:19:36 -0000 2.53.4.3
--- complexobject.c 18 Apr 2002 05:37:51 -0000 2.53.4.4
***************
*** 419,422 ****
--- 419,427 ----
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. */