diff options
author | Neal Norwitz <nnorwitz@gmail.com> | 2006-03-24 08:14:36 (GMT) |
---|---|---|
committer | Neal Norwitz <nnorwitz@gmail.com> | 2006-03-24 08:14:36 (GMT) |
commit | bcc0db82dc9cb474d56a4cc63748583232d9524f (patch) | |
tree | 0107d20b29b61fc7dfd9626ee7257242f8cf6302 /Modules | |
parent | ed483ba63b9c03845386976bccff5d95df5b570a (diff) | |
download | cpython-bcc0db82dc9cb474d56a4cc63748583232d9524f.zip cpython-bcc0db82dc9cb474d56a4cc63748583232d9524f.tar.gz cpython-bcc0db82dc9cb474d56a4cc63748583232d9524f.tar.bz2 |
Get rid of remnants of integer division
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/_ctypes/_ctypes.c | 2 | ||||
-rw-r--r-- | Modules/datetimemodule.c | 5 | ||||
-rw-r--r-- | Modules/mathmodule.c | 2 | ||||
-rw-r--r-- | Modules/operator.c | 8 |
4 files changed, 3 insertions, 14 deletions
diff --git a/Modules/_ctypes/_ctypes.c b/Modules/_ctypes/_ctypes.c index 3a7d3ef..7c5da64 100644 --- a/Modules/_ctypes/_ctypes.c +++ b/Modules/_ctypes/_ctypes.c @@ -3812,7 +3812,6 @@ static PyNumberMethods Simple_as_number = { 0, /* nb_add */ 0, /* nb_subtract */ 0, /* nb_multiply */ - 0, /* nb_divide */ 0, /* nb_remainder */ 0, /* nb_divmod */ 0, /* nb_power */ @@ -4165,7 +4164,6 @@ static PyNumberMethods Pointer_as_number = { 0, /* nb_add */ 0, /* nb_subtract */ 0, /* nb_multiply */ - 0, /* nb_divide */ 0, /* nb_remainder */ 0, /* nb_divmod */ 0, /* nb_power */ diff --git a/Modules/datetimemodule.c b/Modules/datetimemodule.c index b011729..c1a0cb3 100644 --- a/Modules/datetimemodule.c +++ b/Modules/datetimemodule.c @@ -2080,7 +2080,6 @@ static PyNumberMethods delta_as_number = { delta_add, /* nb_add */ delta_subtract, /* nb_subtract */ delta_multiply, /* nb_multiply */ - delta_divide, /* nb_divide */ 0, /* nb_remainder */ 0, /* nb_divmod */ 0, /* nb_power */ @@ -2103,7 +2102,6 @@ static PyNumberMethods delta_as_number = { 0, /*nb_inplace_add*/ 0, /*nb_inplace_subtract*/ 0, /*nb_inplace_multiply*/ - 0, /*nb_inplace_divide*/ 0, /*nb_inplace_remainder*/ 0, /*nb_inplace_power*/ 0, /*nb_inplace_lshift*/ @@ -2665,7 +2663,6 @@ static PyNumberMethods date_as_number = { date_add, /* nb_add */ date_subtract, /* nb_subtract */ 0, /* nb_multiply */ - 0, /* nb_divide */ 0, /* nb_remainder */ 0, /* nb_divmod */ 0, /* nb_power */ @@ -3441,7 +3438,6 @@ static PyNumberMethods time_as_number = { 0, /* nb_add */ 0, /* nb_subtract */ 0, /* nb_multiply */ - 0, /* nb_divide */ 0, /* nb_remainder */ 0, /* nb_divmod */ 0, /* nb_power */ @@ -4526,7 +4522,6 @@ static PyNumberMethods datetime_as_number = { datetime_add, /* nb_add */ datetime_subtract, /* nb_subtract */ 0, /* nb_multiply */ - 0, /* nb_divide */ 0, /* nb_remainder */ 0, /* nb_divmod */ 0, /* nb_power */ diff --git a/Modules/mathmodule.c b/Modules/mathmodule.c index e7fc6dd..731b1d9 100644 --- a/Modules/mathmodule.c +++ b/Modules/mathmodule.c @@ -266,7 +266,7 @@ math_log(PyObject *self, PyObject *args) return NULL; } - ans = PyNumber_Divide(num, den); + ans = PyNumber_TrueDivide(num, den); Py_DECREF(num); Py_DECREF(den); return ans; diff --git a/Modules/operator.c b/Modules/operator.c index 53144f1..24f4e0a 100644 --- a/Modules/operator.c +++ b/Modules/operator.c @@ -65,7 +65,6 @@ spami(truth , PyObject_IsTrue) spam2(op_add , PyNumber_Add) spam2(op_sub , PyNumber_Subtract) spam2(op_mul , PyNumber_Multiply) -spam2(op_div , PyNumber_Divide) spam2(op_floordiv , PyNumber_FloorDivide) spam2(op_truediv , PyNumber_TrueDivide) spam2(op_mod , PyNumber_Remainder) @@ -83,7 +82,6 @@ spam2(op_or_ , PyNumber_Or) spam2(op_iadd , PyNumber_InPlaceAdd) spam2(op_isub , PyNumber_InPlaceSubtract) spam2(op_imul , PyNumber_InPlaceMultiply) -spam2(op_idiv , PyNumber_InPlaceDivide) spam2(op_ifloordiv , PyNumber_InPlaceFloorDivide) spam2(op_itruediv , PyNumber_InPlaceTrueDivide) spam2(op_imod , PyNumber_InPlaceRemainder) @@ -247,9 +245,8 @@ spam2(index, __index__, "index(a) -- Same as a.__index__()") spam2(add,__add__, "add(a, b) -- Same as a + b.") spam2(sub,__sub__, "sub(a, b) -- Same as a - b.") spam2(mul,__mul__, "mul(a, b) -- Same as a * b.") -spam2(div,__div__, "div(a, b) -- Same as a / b when __future__.division is not in effect.") spam2(floordiv,__floordiv__, "floordiv(a, b) -- Same as a // b.") -spam2(truediv,__truediv__, "truediv(a, b) -- Same as a / b when __future__.division is in effect.") +spam2(truediv,__truediv__, "truediv(a, b) -- Same as a / b.") spam2(mod,__mod__, "mod(a, b) -- Same as a % b.") spam2o(neg,__neg__, "neg(a) -- Same as -a.") spam2o(pos,__pos__, "pos(a) -- Same as +a.") @@ -265,9 +262,8 @@ spam2(or_,__or__, "or_(a, b) -- Same as a | b.") spam2(iadd,__iadd__, "iadd(a, b) -- Same as a += b.") spam2(isub,__isub__, "isub(a, b) -- Same as a -= b.") spam2(imul,__imul__, "imul(a, b) -- Same as a *= b.") -spam2(idiv,__idiv__, "idiv(a, b) -- Same as a /= b when __future__.division is not in effect.") spam2(ifloordiv,__ifloordiv__, "ifloordiv(a, b) -- Same as a //= b.") -spam2(itruediv,__itruediv__, "itruediv(a, b) -- Same as a /= b when __future__.division is in effect.") +spam2(itruediv,__itruediv__, "itruediv(a, b) -- Same as a /= b.") spam2(imod,__imod__, "imod(a, b) -- Same as a %= b.") spam2(ilshift,__ilshift__, "ilshift(a, b) -- Same as a <<= b.") spam2(irshift,__irshift__, "irshift(a, b) -- Same as a >>= b.") |