cpython/Objects
Guido van Rossum 242c64256c Add a new function PyNumber_CoerceEx() which works just like
PyNumber_Coerce() except that when the coercion can't be done and no
other exceptions happen, it returns 1 instead of raising an
exception.

Use this function in PyObject_Compare() to avoid raising an exception
simply because two objects with numeric behavior can't be coerced to a
common type; instead, proceed with the non-numeric default comparison.

Note that this is a somewhat questionable practice -- comparisons for
numeric objects shouldn't default to random behavior like this, but it
is required for backward compatibility.  (Case in point, it broke
comparison of kjDict objects to integers in Aaron Watters' kjbuckets
extension.)  A correct fix (for python 2.0) should involve a different
definiton of comparison altogether.
1997-11-19 16:03:17 +00:00
..
abstract.c
classobject.c Undo another glitch of the automatic not-so-Grand Renaming; some local 1997-11-18 19:23:07 +00:00
cobject.c New CObject from Jim Fulton, adds PyCObject_FromVoidPtrAndDesc() and 1997-10-21 19:48:35 +00:00
complexobject.c
dictobject.c Correct Barry's fix -- take care of {}.get(0). 1997-10-20 20:10:00 +00:00
fileobject.c Fix problem discovered by Barry: if you hit ^C to 1997-11-07 19:20:34 +00:00
floatobject.c Hack suggested by Matthias Klose to pull in all relevant entry points 1997-10-31 17:00:30 +00:00
frameobject.c Add cast to realloc/malloc call to shut up AIX compiler. (Vladimir Marangozov) 1997-10-31 20:32:13 +00:00
funcobject.c
intobject.c
listobject.c Rename roundup() to roundupsize(), as there's a macro roundup() in the 1997-08-25 18:36:23 +00:00
longobject.c
Makefile.in
methodobject.c
moduleobject.c
object.c Add a new function PyNumber_CoerceEx() which works just like 1997-11-19 16:03:17 +00:00
rangeobject.c
sliceobject.c
stringobject.c Patch submitted by Brad Howes (with one bug fixed by me): allow 1997-09-08 18:30:11 +00:00
tupleobject.c
typeobject.c
xxobject.c