mirror of
https://github.com/python/cpython.git
synced 2025-08-29 05:05:03 +00:00
* Include/classobject.h, Objects/classobject.c, Python/ceval.c:
entirely redone operator overloading. The rules for class instances are now much more relaxed than for other built-in types (whose coerce must still return two objects of the same type) * Objects/floatobject.c: add overflow check when converting float to int and implement truncation towards zero using ceil/float * Objects/longobject.c: change ValueError to OverflowError when converting to int * Objects/rangeobject.c: modernized * Objects/stringobject.c: use HAVE_LIMITS instead of __STDC__ * Objects/xxobject.c: changed to use new style (not finished?)
This commit is contained in:
parent
2929527aed
commit
03093a248d
6 changed files with 220 additions and 205 deletions
|
@ -159,7 +159,7 @@ getlongvalue(vv)
|
|||
prev = x;
|
||||
x = (x << SHIFT) + v->ob_digit[i];
|
||||
if ((x >> SHIFT) != prev) {
|
||||
err_setstr(ValueError,
|
||||
err_setstr(OverflowError,
|
||||
"long int too long to convert");
|
||||
return -1;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue