From: Christian J. <chr...@gm...> - 2007-07-11 10:29:34
|
I am not informed about how Python 2.2's behavior is, but in Python 2.3 even a number outside the integer range is properly handled by the built-in function int by returning the correct number of type long. Besides, if there really should be an error thrown for a string argument whose designated number exceeds the limit of an int type *OverflowError* would make more sense than ValueError in my opinion. See what I mean below: >>> import sys >>> int('%d' % (sys.maxint+1,)) Traceback (innermost last): File "<console>", line 1, in ? ValueError: invalid literal for __int__: 2147483648 -- Best Regards Christian Junker |