diff options
author | Neal Norwitz <nnorwitz@gmail.com> | 2006-08-21 17:06:07 (GMT) |
---|---|---|
committer | Neal Norwitz <nnorwitz@gmail.com> | 2006-08-21 17:06:07 (GMT) |
commit | 4886cc331ff158f8ede74878a436adfad205bd2d (patch) | |
tree | e9473cb0fd8449b2bdfcea9826e5c795e6ba87e2 /Objects/intobject.c | |
parent | 79212998a8d46712edcf7c4f3fbaefca05a7b08b (diff) | |
download | cpython-4886cc331ff158f8ede74878a436adfad205bd2d.zip cpython-4886cc331ff158f8ede74878a436adfad205bd2d.tar.gz cpython-4886cc331ff158f8ede74878a436adfad205bd2d.tar.bz2 |
Get rid of most of the rest of coerce (slot is still there for now).
Diffstat (limited to 'Objects/intobject.c')
-rw-r--r-- | Objects/intobject.c | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/Objects/intobject.c b/Objects/intobject.c index c378b85..f070404 100644 --- a/Objects/intobject.c +++ b/Objects/intobject.c @@ -580,7 +580,7 @@ i_divmod(register long x, register long y, } static PyObject * -int_div(PyIntObject *x, PyIntObject *y) +int_floor_div(PyIntObject *x, PyIntObject *y) { long xi, yi; long d, m; @@ -872,17 +872,6 @@ int_or(PyIntObject *v, PyIntObject *w) return PyInt_FromLong(a | b); } -static int -int_coerce(PyObject **pv, PyObject **pw) -{ - if (PyInt_Check(*pw)) { - Py_INCREF(*pv); - Py_INCREF(*pw); - return 0; - } - return 1; /* Can't do it */ -} - static PyObject * int_int(PyIntObject *v) { @@ -1036,7 +1025,7 @@ static PyNumberMethods int_as_number = { (binaryfunc)int_and, /*nb_and*/ (binaryfunc)int_xor, /*nb_xor*/ (binaryfunc)int_or, /*nb_or*/ - int_coerce, /*nb_coerce*/ + 0, /*nb_coerce*/ (unaryfunc)int_int, /*nb_int*/ (unaryfunc)int_long, /*nb_long*/ (unaryfunc)int_float, /*nb_float*/ @@ -1052,7 +1041,7 @@ static PyNumberMethods int_as_number = { 0, /*nb_inplace_and*/ 0, /*nb_inplace_xor*/ 0, /*nb_inplace_or*/ - (binaryfunc)int_div, /* nb_floor_divide */ + (binaryfunc)int_floor_div, /* nb_floor_divide */ int_true_divide, /* nb_true_divide */ 0, /* nb_inplace_floor_divide */ 0, /* nb_inplace_true_divide */ |