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/object.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/object.c')
-rw-r--r-- | Objects/object.c | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/Objects/object.c b/Objects/object.c index 516098d..44b3f7d 100644 --- a/Objects/object.c +++ b/Objects/object.c @@ -681,9 +681,7 @@ try_3way_compare(PyObject *v, PyObject *w) b) have different types or a type without tp_compare; and c) don't have a user-defined tp_compare. tp_compare implementations in C assume that both arguments - have their type, so we give up if the coercion fails or if - it yields types which are still incompatible (which can - happen with a user-defined nb_coerce). + have their type, so we give up if the coercion fails. */ c = PyNumber_CoerceEx(&v, &w); if (c < 0) @@ -1513,22 +1511,6 @@ PyNumber_CoerceEx(PyObject **pv, PyObject **pw) return 1; } -/* Coerce two numeric types to the "larger" one. - Increment the reference count on each argument. - Return -1 and raise an exception if no coercion is possible - (and then no reference count is incremented). -*/ -int -PyNumber_Coerce(PyObject **pv, PyObject **pw) -{ - int err = PyNumber_CoerceEx(pv, pw); - if (err <= 0) - return err; - PyErr_SetString(PyExc_TypeError, "number coercion failed"); - return -1; -} - - /* Test whether an object can be called */ int |